Views
No views yet
| Key | Value |
|---|---|
| Modality | Text |
| Training Stage | Posttraining |
| 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-Paddle --local-dir baidu/ERNIE-4.5-0.3B-Paddle
3# SFT
4erniekit train examples/configs/ERNIE-4.5-0.3B/sft/run_sft_8k.yaml
5# DPO
6erniekit train examples/configs/ERNIE-4.5-0.3B/dpo/run_dpo_8k.yaml1python -m fastdeploy.entrypoints.openai.api_server \
2 --model baidu/ERNIE-4.5-0.3B-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-PT"
4
5# load the tokenizer and the model
6tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
7model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
8
9# prepare the model input
10prompt = "Give me a short introduction to large language model."
11messages = [
12 {"role": "user", "content": prompt}
13]
14text = tokenizer.apply_chat_template(
15 messages,
16 tokenize=False,
17 add_generation_prompt=True
18)
19model_inputs = tokenizer([text], add_special_tokens=False, return_tensors="pt").to(model.device)
20
21# conduct text completion
22generated_ids = model.generate(
23 model_inputs.input_ids,
24 max_new_tokens=1024
25)
26output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
27
28# decode the generated ids
29generate_text = tokenizer.decode(output_ids, skip_special_tokens=True).strip("\n")
30print("generate_text:", generate_text)vllm serve baidu/ERNIE-4.5-0.3B-PT --trust-remote-code1@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}