Text Generation
Transformers
Safetensors
English
Chinese
ernie4_5_moe
ERNIE4.5
conversational
Eval Results
Instructions to use baidu/ERNIE-4.5-300B-A47B-Base-PT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use baidu/ERNIE-4.5-300B-A47B-Base-PT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="baidu/ERNIE-4.5-300B-A47B-Base-PT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("baidu/ERNIE-4.5-300B-A47B-Base-PT") model = AutoModelForCausalLM.from_pretrained("baidu/ERNIE-4.5-300B-A47B-Base-PT", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use baidu/ERNIE-4.5-300B-A47B-Base-PT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "baidu/ERNIE-4.5-300B-A47B-Base-PT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "baidu/ERNIE-4.5-300B-A47B-Base-PT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/baidu/ERNIE-4.5-300B-A47B-Base-PT
- SGLang
How to use baidu/ERNIE-4.5-300B-A47B-Base-PT 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 "baidu/ERNIE-4.5-300B-A47B-Base-PT" \ --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": "baidu/ERNIE-4.5-300B-A47B-Base-PT", "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 "baidu/ERNIE-4.5-300B-A47B-Base-PT" \ --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": "baidu/ERNIE-4.5-300B-A47B-Base-PT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use baidu/ERNIE-4.5-300B-A47B-Base-PT with Docker Model Runner:
docker model run hf.co/baidu/ERNIE-4.5-300B-A47B-Base-PT
Add files using upload-large-folder tool
Browse files- model-00002-of-00122.safetensors +3 -0
- model-00004-of-00122.safetensors +3 -0
- model-00011-of-00122.safetensors +3 -0
- model-00017-of-00122.safetensors +3 -0
- model-00018-of-00122.safetensors +3 -0
- model-00037-of-00122.safetensors +3 -0
- model-00038-of-00122.safetensors +3 -0
- model-00043-of-00122.safetensors +3 -0
- model-00045-of-00122.safetensors +3 -0
- model-00048-of-00122.safetensors +3 -0
- model-00061-of-00122.safetensors +3 -0
- model-00070-of-00122.safetensors +3 -0
- model-00074-of-00122.safetensors +3 -0
- model-00082-of-00122.safetensors +3 -0
- model-00094-of-00122.safetensors +3 -0
- model-00099-of-00122.safetensors +3 -0
- model-00100-of-00122.safetensors +3 -0
- model-00101-of-00122.safetensors +3 -0
- model-00102-of-00122.safetensors +3 -0
- model-00103-of-00122.safetensors +3 -0
- model-00115-of-00122.safetensors +3 -0
- model-00120-of-00122.safetensors +3 -0
model-00002-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d2c98475a13fdb0b982700aa5a37afcb549b020fca94fc19e4b2dba358c5b667
|
| 3 |
+
size 4932558616
|
model-00004-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:45a3665642c59ee72882af6f2174cc9be7e0ef4fca3e0a3f1aa6917114c55e16
|
| 3 |
+
size 4884310632
|
model-00011-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e08b29aa8473026b00902914ee41334610cec72392cc9e7b0d6cb84e498be719
|
| 3 |
+
size 4884310632
|
model-00017-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1331e6c1fc6c51174cf3370ffb452eb5c211f51516498abc0589162112e7139
|
| 3 |
+
size 4932511944
|
model-00018-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9b3eae6a96c4dbb03572a55a1392783ff3497fdd0d6769015fda44c589ee1ca9
|
| 3 |
+
size 4884310648
|
model-00037-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9644a5ba4ade6bb449dc8ec715f3932891b6a3dab8f6abb76882dc67356bdead
|
| 3 |
+
size 4884310712
|
model-00038-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f803b639534acbd1c309d2a8cd4a76bcf613a4c5448f5d2bfbfdeff3d71517c4
|
| 3 |
+
size 4932512024
|
model-00043-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5b4ca36da7e6a93d46daa604eb90477174622b5316a6b903c74a3e81bcf0b4b5
|
| 3 |
+
size 4932512032
|
model-00045-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e21617a7d255d3e2c5181b8efc8d7d686d4fdb73d051661d9d9d52dc59e93550
|
| 3 |
+
size 4932512016
|
model-00048-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:16231caa2dcf7d8c92f54123f8dfc697003015c8e6ac81c037559e91db96a8db
|
| 3 |
+
size 4932512032
|
model-00061-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:52c881da59abd6a8a2b77b77423f8e7b04f79363a5880da8a6ac7af878c8339c
|
| 3 |
+
size 4884310704
|
model-00070-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:641f38f13465b7def3ea02a0861df87e3848a06ce1a248a134387e89b69a9ef4
|
| 3 |
+
size 4884310712
|
model-00074-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:534a3e639c0d1f17b744c900c61d7ef8533047ecd16ffadeb8ee2b0d8c8ffa78
|
| 3 |
+
size 4932512032
|
model-00082-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e9ff8edcd866696cf2bf5cdddb048a296f0eed5e97016c778a57b5dc4f722f9
|
| 3 |
+
size 4884310704
|
model-00094-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:105e6dc9b7ae35aecaa4600dd97e25d8f8808ff5d43af7cb2e6a22e2aed786df
|
| 3 |
+
size 4884310704
|
model-00099-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aeb2fd89536c955d58510ca36b7fbee43d744700121cd31cad0967aef4c221bc
|
| 3 |
+
size 4982860248
|
model-00100-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:454393542ca0043dc592e7de339962d30b1926067cfa7f5cf92172190299e8de
|
| 3 |
+
size 4932512032
|
model-00101-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:661c91a353b88588c42163429bdfdb7ad77a76faed5128ecba0293a4ef177495
|
| 3 |
+
size 4884310704
|
model-00102-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:36de011d7c0e79a00001f6f4626992fd93b6eb6c68c6878892a3bfc996d75da9
|
| 3 |
+
size 4932512032
|
model-00103-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1a44218d751de4f579db930bd1aa0ce5c88360bf6644b3d0b91970071a3d3ca0
|
| 3 |
+
size 4884310712
|
model-00115-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19ddee06f4af5d84d30776df4bf2041e5a52f13cc1081032276778782d778840
|
| 3 |
+
size 4884310704
|
model-00120-of-00122.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6722935bf35deed2b0bb96529bad9c6ab8d9c1619f654e8553cf79da43cf093b
|
| 3 |
+
size 4884310704
|