Instructions to use OpenNLPLab/TransNormerLLM-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenNLPLab/TransNormerLLM-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenNLPLab/TransNormerLLM-7B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("OpenNLPLab/TransNormerLLM-7B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OpenNLPLab/TransNormerLLM-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenNLPLab/TransNormerLLM-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenNLPLab/TransNormerLLM-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpenNLPLab/TransNormerLLM-7B
- SGLang
How to use OpenNLPLab/TransNormerLLM-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 "OpenNLPLab/TransNormerLLM-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": "OpenNLPLab/TransNormerLLM-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 "OpenNLPLab/TransNormerLLM-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": "OpenNLPLab/TransNormerLLM-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpenNLPLab/TransNormerLLM-7B with Docker Model Runner:
docker model run hf.co/OpenNLPLab/TransNormerLLM-7B
| { | |
| "metadata": { | |
| "total_size": 13673439232 | |
| }, | |
| "weight_map": { | |
| "lm_head.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.embed_tokens.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.0.channel_mixer.l1.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.0.channel_mixer.l2.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.0.channel_mixer.l3.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.0.token_mixer.lrpe.theta": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.0.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.0.token_mixer.qkvu_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.1.channel_mixer.l1.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.1.channel_mixer.l2.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.1.channel_mixer.l3.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.1.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.1.token_mixer.qkvu_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.10.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.10.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.10.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.10.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.10.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.11.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.11.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.11.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.11.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.11.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.12.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.12.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.12.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.12.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.12.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.13.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.13.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.13.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.13.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.13.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.14.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.14.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.14.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.14.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.14.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.15.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.15.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.15.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.15.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.15.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.16.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.16.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.16.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.16.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.16.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.17.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.17.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.17.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.17.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.17.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.18.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.18.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.18.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.18.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.18.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.19.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.19.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.19.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.19.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.19.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.2.channel_mixer.l1.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.2.channel_mixer.l2.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.2.channel_mixer.l3.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.2.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.2.token_mixer.qkvu_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.20.channel_mixer.l1.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.20.channel_mixer.l2.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.20.channel_mixer.l3.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.20.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.20.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.21.channel_mixer.l1.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.21.channel_mixer.l2.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.21.channel_mixer.l3.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.21.token_mixer.out_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.21.token_mixer.qkvu_proj.weight": "pytorch_model-00002-of-00003.bin", | |
| "model.layers.22.channel_mixer.l1.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.22.channel_mixer.l2.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.22.channel_mixer.l3.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.22.token_mixer.out_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.22.token_mixer.qkvu_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.23.channel_mixer.l1.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.23.channel_mixer.l2.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.23.channel_mixer.l3.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.23.token_mixer.out_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.23.token_mixer.qkvu_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.24.channel_mixer.l1.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.24.channel_mixer.l2.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.24.channel_mixer.l3.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.24.token_mixer.out_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.24.token_mixer.qkvu_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.25.channel_mixer.l1.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.25.channel_mixer.l2.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.25.channel_mixer.l3.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.25.token_mixer.out_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.25.token_mixer.qkvu_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.26.channel_mixer.l1.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.26.channel_mixer.l2.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.26.channel_mixer.l3.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.26.token_mixer.out_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.26.token_mixer.qkvu_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.27.channel_mixer.l1.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.27.channel_mixer.l2.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.27.channel_mixer.l3.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.27.token_mixer.out_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.27.token_mixer.qkvu_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.28.channel_mixer.l1.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.28.channel_mixer.l2.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.28.channel_mixer.l3.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.28.token_mixer.out_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.28.token_mixer.qkvu_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.29.channel_mixer.l1.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.29.channel_mixer.l2.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.29.channel_mixer.l3.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.29.token_mixer.out_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.29.token_mixer.qkvu_proj.weight": "pytorch_model-00003-of-00003.bin", | |
| "model.layers.3.channel_mixer.l1.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.3.channel_mixer.l2.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.3.channel_mixer.l3.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.3.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.3.token_mixer.qkvu_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.4.channel_mixer.l1.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.4.channel_mixer.l2.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.4.channel_mixer.l3.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.4.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.4.token_mixer.qkvu_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.5.channel_mixer.l1.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.5.channel_mixer.l2.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.5.channel_mixer.l3.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.5.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.5.token_mixer.qkvu_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.6.channel_mixer.l1.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.6.channel_mixer.l2.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.6.channel_mixer.l3.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.6.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.6.token_mixer.qkvu_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.7.channel_mixer.l1.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.7.channel_mixer.l2.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.7.channel_mixer.l3.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.7.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.7.token_mixer.qkvu_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.8.channel_mixer.l1.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.8.channel_mixer.l2.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.8.channel_mixer.l3.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.8.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.8.token_mixer.qkvu_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.9.channel_mixer.l1.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.9.channel_mixer.l2.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.9.channel_mixer.l3.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.9.token_mixer.out_proj.weight": "pytorch_model-00001-of-00003.bin", | |
| "model.layers.9.token_mixer.qkvu_proj.weight": "pytorch_model-00001-of-00003.bin" | |
| } | |
| } | |