Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

AmaadMartin
/
k_2_model

Text Generation
Transformers
PyTorch
qwen
custom_code
Model card Files Files and versions
xet
Community

Instructions to use AmaadMartin/k_2_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use AmaadMartin/k_2_model with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="AmaadMartin/k_2_model", trust_remote_code=True)
    # Load model directly
    from transformers import AutoModelForCausalLM
    model = AutoModelForCausalLM.from_pretrained("AmaadMartin/k_2_model", trust_remote_code=True, dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use AmaadMartin/k_2_model with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "AmaadMartin/k_2_model"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "AmaadMartin/k_2_model",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker
    docker model run hf.co/AmaadMartin/k_2_model
  • SGLang

    How to use AmaadMartin/k_2_model with SGLang:

    Install from pip and serve model
    # Install SGLang from pip:
    pip install sglang
    # Start the SGLang server:
    python3 -m sglang.launch_server \
        --model-path "AmaadMartin/k_2_model" \
        --host 0.0.0.0 \
        --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "AmaadMartin/k_2_model",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker images
    docker run --gpus all \
        --shm-size 32g \
        -p 30000:30000 \
        -v ~/.cache/huggingface:/root/.cache/huggingface \
        --env "HF_TOKEN=<secret>" \
        --ipc=host \
        lmsysorg/sglang:latest \
        python3 -m sglang.launch_server \
            --model-path "AmaadMartin/k_2_model" \
            --host 0.0.0.0 \
            --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "AmaadMartin/k_2_model",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use AmaadMartin/k_2_model with Docker Model Runner:

    docker model run hf.co/AmaadMartin/k_2_model
k_2_model
19.3 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 14 commits
AmaadMartin's picture
AmaadMartin
Upload handler.py
4b95965 verified about 2 years ago
  • .gitattributes
    1.52 kB
    initial commit about 2 years ago
  • config.json
    1.21 kB
    Upload model about 2 years ago
  • generation_config.json
    221 Bytes
    Upload model about 2 years ago
  • handler.py
    4.43 kB
    Upload handler.py about 2 years ago
  • pytorch_model-00001-of-00002.bin

    Detected Pickle imports (3)

    • "torch.HalfStorage",
    • "collections.OrderedDict",
    • "torch._utils._rebuild_tensor_v2"

    What is a pickle import?

    9.97 GB
    xet
    Upload model about 2 years ago
  • pytorch_model-00002-of-00002.bin

    Detected Pickle imports (3)

    • "torch.HalfStorage",
    • "collections.OrderedDict",
    • "torch._utils._rebuild_tensor_v2"

    What is a pickle import?

    9.34 GB
    xet
    Upload model about 2 years ago
  • pytorch_model.bin.index.json
    79.9 kB
    Upload model about 2 years ago
  • qwen.tiktoken
    2.56 MB
    Upload tokenizer about 2 years ago
  • requirements.txt
    122 Bytes
    Upload requirements.txt about 2 years ago
  • special_tokens_map.json
    35 Bytes
    Upload tokenizer about 2 years ago
  • tokenization_qwen.py
    21.9 kB
    Update tokenization_qwen.py about 2 years ago
  • tokenizer_config.json
    238 Bytes
    Upload tokenizer about 2 years ago