Views
No views yet
[!NOTE] Note: "-Paddle" models use PaddlePaddle weights, while "-PT" models use Transformer-style PyTorch weights.
[!NOTE] Note: The Base model only supports text completion. For evaluation, use thecompletionAPI (notchat_completion) in vLLM/FastDeploy.
| Key | Value |
|---|---|
| Modality | Text |
| Training Stage | Pretraining |
| Params(Total / Activated) | 300B / 47B |
| Layers | 54 |
| Heads(Q/KV) | 64 / 8 |
| Text Experts(Total / Activated) | 64 / 8 |
| Vision Experts(Total / Activated) | 64 / 8 |
| Context Length | 131072 |
transformers librarytransformers library installed
(upcoming version 4.54.0 or the latest version)1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_name = "baidu/ERNIE-4.5-300B-A47B-Base-PT"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 device_map="auto",
9 torch_dtype=torch.bfloat16
10)
11
12prompt = "Large language model is"
13model_inputs = tokenizer([prompt], add_special_tokens=False, return_tensors="pt").to(model.device)
14
15generated_ids = model.generate(
16 model_inputs.input_ids,
17 max_new_tokens=1024
18)
19result = tokenizer.decode(generated_ids[0].tolist(), skip_special_tokens=True)
20print("result:", result)1# 80G * 16 GPU
2vllm serve baidu/ERNIE-4.5-300B-A47B-Base-PT --tensor-parallel-size 161# FP8 online quantification 80G * 8 GPU
2vllm serve baidu/ERNIE-4.5-300B-A47B-Base-PT --tensor-parallel-size 8 --quantization fp81@misc{ernie2025technicalreport,
2 title={ERNIE 4.5 Technical Report},
3 author={Baidu ERNIE Team},
4 year={2025},
5 eprint={},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={}
9}