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"
4model_name = "baidu/ERNIE-4.5-0.3B-PT"
5
6# load the tokenizer and the model
7tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
8model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
9
10# prepare the model input
11prompt = "Give me a short introduction to large language model."
12messages = [
13 {"role": "user", "content": prompt}
14]
15text = tokenizer.apply_chat_template(
16 messages,
17 tokenize=False,
18 add_generation_prompt=True
19)
20model_inputs = tokenizer([text], add_special_tokens=False, return_tensors="pt").to(model.device)
21
22# conduct text completion
23generated_ids = model.generate(
24 model_inputs.input_ids,
25 max_new_tokens=1024
26)
27output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
28
29# decode the generated ids
30generate_text = tokenizer.decode(output_ids, skip_special_tokens=True).strip("\n")
31print("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}