Instructions to use OpenNLPLab/TransNormerLLM2-3B-300B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenNLPLab/TransNormerLLM2-3B-300B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenNLPLab/TransNormerLLM2-3B-300B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("OpenNLPLab/TransNormerLLM2-3B-300B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OpenNLPLab/TransNormerLLM2-3B-300B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenNLPLab/TransNormerLLM2-3B-300B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenNLPLab/TransNormerLLM2-3B-300B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpenNLPLab/TransNormerLLM2-3B-300B
- SGLang
How to use OpenNLPLab/TransNormerLLM2-3B-300B 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/TransNormerLLM2-3B-300B" \ --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/TransNormerLLM2-3B-300B", "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/TransNormerLLM2-3B-300B" \ --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/TransNormerLLM2-3B-300B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpenNLPLab/TransNormerLLM2-3B-300B with Docker Model Runner:
docker model run hf.co/OpenNLPLab/TransNormerLLM2-3B-300B
Fix 3B config error
Browse files- config.json +7 -5
config.json
CHANGED
|
@@ -12,9 +12,9 @@
|
|
| 12 |
"vocab_size": 64000,
|
| 13 |
"use_cache": true,
|
| 14 |
"init_std": 0.02,
|
| 15 |
-
"decoder_embed_dim":
|
| 16 |
-
"decoder_layers":
|
| 17 |
-
"decoder_attention_heads":
|
| 18 |
"no_scale_embedding": true,
|
| 19 |
"add_bos_token": false,
|
| 20 |
"norm_type": "simplermsnorm",
|
|
@@ -48,11 +48,13 @@
|
|
| 48 |
0,
|
| 49 |
0,
|
| 50 |
0,
|
|
|
|
|
|
|
| 51 |
0
|
| 52 |
],
|
| 53 |
-
"hidden_dim":
|
| 54 |
"linear_act_fun": "swish",
|
| 55 |
-
"glu_dim":
|
| 56 |
"bias": false,
|
| 57 |
"torch_dtype": "bfloat16",
|
| 58 |
"transformers_version": "4.32.0"
|
|
|
|
| 12 |
"vocab_size": 64000,
|
| 13 |
"use_cache": true,
|
| 14 |
"init_std": 0.02,
|
| 15 |
+
"decoder_embed_dim": 2560,
|
| 16 |
+
"decoder_layers": 32,
|
| 17 |
+
"decoder_attention_heads": 20,
|
| 18 |
"no_scale_embedding": true,
|
| 19 |
"add_bos_token": false,
|
| 20 |
"norm_type": "simplermsnorm",
|
|
|
|
| 48 |
0,
|
| 49 |
0,
|
| 50 |
0,
|
| 51 |
+
0,
|
| 52 |
+
0,
|
| 53 |
0
|
| 54 |
],
|
| 55 |
+
"hidden_dim": 2560,
|
| 56 |
"linear_act_fun": "swish",
|
| 57 |
+
"glu_dim": 6912,
|
| 58 |
"bias": false,
|
| 59 |
"torch_dtype": "bfloat16",
|
| 60 |
"transformers_version": "4.32.0"
|