Instructions to use internlm/internlm2_5-7b-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use internlm/internlm2_5-7b-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="internlm/internlm2_5-7b-chat", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("internlm/internlm2_5-7b-chat", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use internlm/internlm2_5-7b-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "internlm/internlm2_5-7b-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "internlm/internlm2_5-7b-chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/internlm/internlm2_5-7b-chat
- SGLang
How to use internlm/internlm2_5-7b-chat 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/internlm2_5-7b-chat" \ --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": "internlm/internlm2_5-7b-chat", "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 "internlm/internlm2_5-7b-chat" \ --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": "internlm/internlm2_5-7b-chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use internlm/internlm2_5-7b-chat with Docker Model Runner:
docker model run hf.co/internlm/internlm2_5-7b-chat
Commit History
-
replace get_max_length
x54-729eb72b54
-
Update README.md
Verified signature4434a5f -
Update README.md
Verified signature814077c
-
update modeling file to newest
x54-7299b8d955
-
Update README.md
Verified signaturee2c47cf
-
Update README.md
Verified signature56087a4 -
Update README.md
Verified signature70b026c
-
Update README.md
Verified signature9dc8536
-
update zh examples url
x54-7296a4dae2 -
Merge branch 'main' of https://huggingface.co/internlm/internlm2_5-7b-chat into main
x54-729a763864 -
update examples url
x54-729e221543
-
Update README.md
Verified signature0904784 -
Update README.md
Verified signature379f293 -
Update README.md (#2)
Verified signature- Update README.md (dea069028013ccfcf71c7825161300150cc44f64)edcc3cb
-
transformer version
x54-729e760bb0 -
update links in readme
Verified signaturebebb001 -
Update README.md
Verified signaturec955e86 -
Update README.md (#1)
Verified signature- Update README.md (134ed270094cc30dcaf10c6422634428af24be0a) Co-authored-by: Songyang Zhang <zsytony@users.noreply.huggingface.co>713a22d
-
Update README.md
zhangwenweid201a0f
-
upload model
cb63b73 -
initial commit
Verified signature1a71688