Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

nvidia
/
Hymba-1.5B-Instruct

Text Generation
Transformers
Safetensors
hymba
conversational
custom_code
Model card Files Files and versions
xet
Community
12

Instructions to use nvidia/Hymba-1.5B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use nvidia/Hymba-1.5B-Instruct with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="nvidia/Hymba-1.5B-Instruct", trust_remote_code=True)
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    pipe(messages)
    # Load model directly
    from transformers import AutoModelForCausalLM
    model = AutoModelForCausalLM.from_pretrained("nvidia/Hymba-1.5B-Instruct", trust_remote_code=True, dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use nvidia/Hymba-1.5B-Instruct with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "nvidia/Hymba-1.5B-Instruct"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "nvidia/Hymba-1.5B-Instruct",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
    Use Docker
    docker model run hf.co/nvidia/Hymba-1.5B-Instruct
  • SGLang

    How to use nvidia/Hymba-1.5B-Instruct 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 "nvidia/Hymba-1.5B-Instruct" \
        --host 0.0.0.0 \
        --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "nvidia/Hymba-1.5B-Instruct",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
    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 "nvidia/Hymba-1.5B-Instruct" \
            --host 0.0.0.0 \
            --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "nvidia/Hymba-1.5B-Instruct",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
  • Docker Model Runner

    How to use nvidia/Hymba-1.5B-Instruct with Docker Model Runner:

    docker model run hf.co/nvidia/Hymba-1.5B-Instruct

Added chat_template

#1
by shizhediao2 - opened Nov 4, 2024
base: refs/heads/main
←
from: refs/pr/1
Discussion Files changed
+839
-93886
initial commit59246ee5
Upload HymbaForCausalLMa9cf19c8
Update README.md85753570
Create images/placeholderf14398c8
Upload 5 filesb0dee1de
Delete images/placeholder3bc9d65b
Update README.mdbeddbb25
Update README.mdac10307d
Update README.mdd253bfd8
Rename images/images_macro_arch.png to images/macro_arch.png55e786f3
Rename images/images_performance1.png to images/performance1.png0b0b7df1
Rename images/images_performance2.png to images/performance2.pngc25dc118
Rename images/images_module.png to images/module.png3d229b0c
shizhediao2
NVIDIA org Nov 4, 2024
This comment has been hidden
Added chat_templatef9ced0c9
YongganFu changed pull request status to closed Nov 26, 2024

· Sign up or log in to comment

Company
TOS Privacy About Careers
Website
Models Datasets Spaces Pricing Docs