Instructions to use internlm/internlm-chat-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use internlm/internlm-chat-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="internlm/internlm-chat-7b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("internlm/internlm-chat-7b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use internlm/internlm-chat-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "internlm/internlm-chat-7b" # 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-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/internlm/internlm-chat-7b
- SGLang
How to use internlm/internlm-chat-7b 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-7b" \ --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-7b", "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-7b" \ --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-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use internlm/internlm-chat-7b with Docker Model Runner:
docker model run hf.co/internlm/internlm-chat-7b
Commit History
-
update opencompass url
x54-7294e2d2e1
-
transformer version
x54-729110c998
-
update copyright (#9)
Verified signature- update copyright (141fdf852ab262d6eb180ab567a4218264260ab3) Co-authored-by: Shuhao Xing <x54-729@users.noreply.huggingface.co>278b13c
-
remove unnecessary attention_drop
x54-729281d770
-
fix import error
x54-7296e1fdc1 -
update config
x54-729bcad9ec -
support flash attn 2
x54-7294881d44
-
Update README.md
Verified signature0edf336
-
Update configuration_internlm.py
Verified signature739d369
-
Update modeling_internlm.py
84abffb -
Update modeling_internlm.py
41d18d0 -
Fix batch generation
d5770d1
-
fix: fix meta instruction
ZwwWayne28a9aa9
-
v1.0.3 (#7)
- v1.0.3 (1cd199cf50b8d3b1d42cbd1a06ede32deecfe05f)ec21cec
-
Update config.json
a703db9 -
Add stream_char example; Add torch_dtype to example
caaa9dd -
Support dynamic ntk rope
2815e26 -
Support dynamic ntk rope
0ed6e4a -
Support dynamic ntk rope
06befe5
-
fix pad_token_id
d4fa2db -
fix pad_token_id
1e1f32e
-
Fix InternLMTokenizer
11a2f20 -
Fix InternLMTokenizer
43367a7
-
Update modeling_internlm.py
add638c
-
Add github link
ae7d989
-
Fix streaming_chat
697218d
-
update model file
bae79c6
-
Update LICENSE in README
297f4f6
-
Add LICENSE and change pipeline tag
ed5e355
-
delete old checkpoint
a3c578a -
reshard the model
e3ee81f
-
Update config.json
1a63287
-
Update modeling_internlm.py
dd2fa16
-
Update README.md
4217652
-
Update config.json
1e2297e -
Update config.json
30fa22a -
Upload internlm-chat-7b
659ed91 -
initial commit
14e30d3