Instructions to use tiny-random/ernie-4.5-vl-moe with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiny-random/ernie-4.5-vl-moe with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="tiny-random/ernie-4.5-vl-moe")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tiny-random/ernie-4.5-vl-moe", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiny-random/ernie-4.5-vl-moe with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiny-random/ernie-4.5-vl-moe" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/ernie-4.5-vl-moe", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tiny-random/ernie-4.5-vl-moe
- SGLang
How to use tiny-random/ernie-4.5-vl-moe with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "tiny-random/ernie-4.5-vl-moe" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/ernie-4.5-vl-moe", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "tiny-random/ernie-4.5-vl-moe" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/ernie-4.5-vl-moe", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tiny-random/ernie-4.5-vl-moe with Docker Model Runner:
docker model run hf.co/tiny-random/ernie-4.5-vl-moe
| { | |
| "auto_map": { | |
| "AutoImageProcessor": "baidu/ERNIE-4.5-VL-424B-A47B-PT--processing_ernie4_5_vl.Ernie4_5_VLImageProcessor", | |
| "AutoProcessor": "baidu/ERNIE-4.5-VL-424B-A47B-PT--processing_ernie4_5_vl.Ernie4_5_VLProcessor" | |
| }, | |
| "crop_size": { | |
| "height": 224, | |
| "width": 224 | |
| }, | |
| "do_center_crop": false, | |
| "do_convert_rgb": true, | |
| "do_normalize": true, | |
| "do_rescale": true, | |
| "do_resize": true, | |
| "image_mean": [ | |
| 0.48145466, | |
| 0.4578275, | |
| 0.40821073 | |
| ], | |
| "image_processor_type": "Ernie4_5_VLImageProcessor", | |
| "image_std": [ | |
| 0.26862954, | |
| 0.26130258, | |
| 0.27577711 | |
| ], | |
| "max_pixels": 4816896, | |
| "merge_size": 2, | |
| "min_pixels": 3136, | |
| "patch_size": 14, | |
| "processor_class": "Ernie4_5_VLProcessor", | |
| "resample": 3, | |
| "rescale_factor": 0.00392156862745098, | |
| "size": { | |
| "max_pixels": 4816896, | |
| "min_pixels": 3136 | |
| }, | |
| "temporal_conv_size": 2 | |
| } |