Views
No views yet
[!NOTE] Note: "-Paddle" models use PaddlePaddle weights, while "-PT" models use Transformer-style PyTorch weights.
| Key | Value |
|---|---|
| Modality | Text & Vision |
| Training Stage | Posttraining |
| Params(Total / Activated) | 28B / 3B |
| Layers | 28 |
| Heads(Q/KV) | 20 / 4 |
| Text Experts(Total / Activated) | 64 / 6 |
| Vision Experts(Total / Activated) | 64 / 6 |
| Shared Experts | 2 |
| Context Length | 131072 |
transformers library1import torch
2from transformers import AutoProcessor, AutoTokenizer, AutoModelForCausalLM
3
4model_path = 'baidu/ERNIE-4.5-VL-28B-A3B-PT'
5model = AutoModelForCausalLM.from_pretrained(
6 model_path,
7 device_map="auto",
8 torch_dtype=torch.bfloat16,
9 trust_remote_code=True
10)
11
12processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
13processor.eval()
14model.add_image_preprocess(processor)
15
16messages = [
17 {
18 "role": "user",
19 "content": [
20 {"type": "text", "text": "Describe the image."},
21 {"type": "image_url", "image_url": {"url": "https://paddlenlp.bj.bcebos.com/datasets/paddlemix/demo_images/example1.jpg"}},
22 ]
23 },
24]
25
26text = processor.apply_chat_template(
27 messages, tokenize=False, add_generation_prompt=True, enable_thinking=False
28)
29image_inputs, video_inputs = processor.process_vision_info(messages)
30inputs = processor(
31 text=[text],
32 images=image_inputs,
33 videos=video_inputs,
34 padding=True,
35 return_tensors="pt",
36)
37
38device = next(model.parameters()).device
39inputs = inputs.to(device)
40
41generated_ids = model.generate(
42 inputs=inputs['input_ids'].to(device),
43 **inputs,
44 max_new_tokens=128
45 )
46output_text = processor.decode(generated_ids[0])
47print(output_text)vllm serve baidu/ERNIE-4.5-VL-28B-A3B-PT --trust-remote-code 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}