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

  • Log In
  • Sign Up

internlm
/
internlm-chat-20b-4bit

Text Generation
Transformers
PyTorch
internlm
feature-extraction
custom_code
Model card Files Files and versions
xet
Community
12

Instructions to use internlm/internlm-chat-20b-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use internlm/internlm-chat-20b-4bit with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="internlm/internlm-chat-20b-4bit", trust_remote_code=True)
    # Load model directly
    from transformers import AutoModel
    model = AutoModel.from_pretrained("internlm/internlm-chat-20b-4bit", trust_remote_code=True, dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use internlm/internlm-chat-20b-4bit with vLLM:

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

    How to use internlm/internlm-chat-20b-4bit 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 "internlm/internlm-chat-20b-4bit" \
        --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": "internlm/internlm-chat-20b-4bit",
    		"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 "internlm/internlm-chat-20b-4bit" \
            --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": "internlm/internlm-chat-20b-4bit",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use internlm/internlm-chat-20b-4bit with Docker Model Runner:

    docker model run hf.co/internlm/internlm-chat-20b-4bit
New discussion
Resources
  • PR & discussions documentation
  • Code of Conduct
  • Hub documentation

Adding `safetensors` variant of this model

#12 opened 12 months ago by
SFconvertbot

although tokenizer.model exists , deploy is complaining that it does not

2
#8 opened over 2 years ago by
TeaCult

Assertion Error

😔 1
1
#6 opened over 2 years ago by
BBLL3456

推理报错 [TM][ERROR] CUDA runtime error: invalid argument

1
#5 opened over 2 years ago by
kkkknddnjfks

👍

#4 opened over 2 years ago by
hiarcs

[Bug] win11下gpu:4090使用docker部署internlm-chat-20b-4bit,显示WARNING: Can not find tokenizer.json. It may take long time to initialize the tokenizer.提问时无反馈卡死。

1
#3 opened over 2 years ago by
appleatiger

python3: No module named lmdeploy.serve.turbomind.__main__;

1
#1 opened over 2 years ago by
victorx98
Company
TOS Privacy About Careers
Website
Models Datasets Spaces Pricing Docs