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

  • Log In
  • Sign Up

cmpatino
/
nanowhale-100m

Text Generation
Transformers
Safetensors
English
deepseek_v4
deepseek
Mixture of Experts
causal-lm
sft
chat
conversational
custom_code
Model card Files Files and versions
xet
Community

Instructions to use cmpatino/nanowhale-100m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use cmpatino/nanowhale-100m with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="cmpatino/nanowhale-100m", trust_remote_code=True)
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    pipe(messages)
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("cmpatino/nanowhale-100m", trust_remote_code=True)
    model = AutoModelForCausalLM.from_pretrained("cmpatino/nanowhale-100m", trust_remote_code=True)
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    inputs = tokenizer.apply_chat_template(
    	messages,
    	add_generation_prompt=True,
    	tokenize=True,
    	return_dict=True,
    	return_tensors="pt",
    ).to(model.device)
    
    outputs = model.generate(**inputs, max_new_tokens=40)
    print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use cmpatino/nanowhale-100m with vLLM:

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

    How to use cmpatino/nanowhale-100m 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 "cmpatino/nanowhale-100m" \
        --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": "cmpatino/nanowhale-100m",
    		"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 "cmpatino/nanowhale-100m" \
            --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": "cmpatino/nanowhale-100m",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
  • Docker Model Runner

    How to use cmpatino/nanowhale-100m with Docker Model Runner:

    docker model run hf.co/cmpatino/nanowhale-100m
nanowhale-100m
452 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 12 commits
cmpatino's picture
cmpatino HF Staff
docs: simplify Usage to from_pretrained (now works after modeling fix)
36dd12a verified 1 day ago
  • .gitattributes
    1.52 kB
    initial commit 2 days ago
  • README.md
    3.75 kB
    docs: simplify Usage to from_pretrained (now works after modeling fix) 1 day ago
  • chat_template.jinja
    1.1 kB
    Add chat template 2 days ago
  • config.json
    1.52 kB
    Add config.json 2 days ago
  • configuration_deepseek_v4.py
    4.64 kB
    Add configuration_deepseek_v4.py 2 days ago
  • generation_config.json
    226 Bytes
    Add generation config 2 days ago
  • model.safetensors
    442 MB
    xet
    Add model.safetensors 2 days ago
  • modeling_deepseek_v4.py
    29.4 kB
    fix: use nn.init.* in _init_weights + recompute freqs_cis buffer on load 1 day ago
  • tokenizer.json
    10.1 MB
    Add tokenizer.json 2 days ago
  • tokenizer_config.json
    316 Bytes
    Add tokenizer config 2 days ago