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 | 0.36B |
| Layers | 18 |
| Heads(Q/KV) | 16 / 2 |
| Context Length | 131072 |
1# Download Model
2huggingface-cli download baidu/ERNIE-4.5-0.3B-Base-Paddle --local-dir baidu/ERNIE-4.5-0.3B-Base-Paddle
3# SFT
4erniekit train examples/configs/ERNIE-4.5-0.3B/sft/run_sft_8k.yaml model_name_or_path=baidu/ERNIE-4.5-0.3B-Base-Paddle
5# DPO
6erniekit train examples/configs/ERNIE-4.5-0.3B/dpo/run_dpo_8k.yaml model_name_or_path=baidu/ERNIE-4.5-0.3B-Base-Paddle1python -m fastdeploy.entrypoints.openai.api_server \
2 --model baidu/ERNIE-4.5-0.3B-Base-Paddle \
3 --port 8180 \
4 --metrics-port 8181 \
5 --engine-worker-queue-port 8182 \
6 --max-model-len 32768 \
7 --max-num-seqs 32transformers library1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "baidu/ERNIE-4.5-0.3B-Base-PT"
4tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
5model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
6
7prompt = "Large language model is"
8model_inputs = tokenizer([prompt], add_special_tokens=False, return_tensors="pt").to(model.device)
9
10generated_ids = model.generate(
11 model_inputs.input_ids,
12 max_new_tokens=1024
13)
14result = tokenizer.decode(generated_ids[0].tolist(), skip_special_tokens=True)
15print("result:", result)1@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}