Instructions to use internlm/internlm-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use internlm/internlm-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="internlm/internlm-7b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("internlm/internlm-7b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use internlm/internlm-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "internlm/internlm-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-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/internlm/internlm-7b
- SGLang
How to use internlm/internlm-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-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-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-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-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use internlm/internlm-7b with Docker Model Runner:
docker model run hf.co/internlm/internlm-7b
Commit History
-
Upload folder using huggingface_hub
Verified signatureb4bec1c
-
remove unnecessary attention_drop
x54-72990ff09a
-
fix import error
x54-7297f2ea77 -
update config
x54-72905e5c8c -
support flash attn 2
x54-729fb77cf9
-
Update modeling_internlm.py
f3931fb -
fix
5214c14 -
FIx batch generation
cea5d14
-
Update config.json
9f7e25e -
Update README.md
2a32eb6 -
Support dynamic ntk rope
190c1be -
Support dynamic ntk rope
2765861 -
Support dynamic ntk rope
7e775a2
-
fix pad_token_id
592b0ef -
fix pad_token_id
6534704
-
Fix InternLMTokenizer
644e2a5 -
Fix InternLMTokenizer
c841c4c
-
Small change to chat prompt
90d3af9
-
Add github link
31117fd
-
Fix streaming_chat
2667fa7
-
Update LICENSE in README
bfbab49 -
Update LICENSE in README
542fec0
-
Update License
ab86333 -
Add LICENSE and change pipeline tag
49d3d08
-
delete old checkpoint
939a68c -
reshard the checkpoint
d0eb239
-
Update config.json
712d941
-
Update README.md
9b426e5 -
Update modeling_internlm.py
551cd75
-
Update README.md
0b1146f -
Update README.md
2d3a322 -
Update README.md
43ed609
-
Update config.json
88cd482 -
Update config.json
e09107d -
internlm-7b
1fb8f04 -
initial commit
60800f5