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)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("internlm/internlm2_5-7b-chat", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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
Update README.md
Browse files
README.md
CHANGED
|
@@ -172,7 +172,7 @@ Find more details in the [vLLM documentation](https://docs.vllm.ai/en/latest/ind
|
|
| 172 |
|
| 173 |
## Open Source License
|
| 174 |
|
| 175 |
-
|
| 176 |
|
| 177 |
## Citation
|
| 178 |
|
|
@@ -321,7 +321,7 @@ curl http://localhost:8000/v1/chat/completions \
|
|
| 321 |
|
| 322 |
## 开源许可证
|
| 323 |
|
| 324 |
-
本仓库的代码
|
| 325 |
|
| 326 |
## 引用
|
| 327 |
|
|
|
|
| 172 |
|
| 173 |
## Open Source License
|
| 174 |
|
| 175 |
+
The code is licensed under Apache-2.0, while model weights are fully open for academic research and also allow free commercial usage. To apply for a commercial license, please fill in the application form (English)/申请表(中文). For other questions or collaborations, please contact internlm@pjlab.org.cn.
|
| 176 |
|
| 177 |
## Citation
|
| 178 |
|
|
|
|
| 321 |
|
| 322 |
## 开源许可证
|
| 323 |
|
| 324 |
+
本仓库的代码依照 Apache-2.0 协议开源。模型权重对学术研究完全开放,也可申请免费的商业使用授权(申请表)。其他问题与合作请联系 internlm@pjlab.org.cn。
|
| 325 |
|
| 326 |
## 引用
|
| 327 |
|