Image-Text-to-Text
Transformers
Safetensors
English
Chinese
ernie4_5_moe_vl
ERNIE4.5
conversational
custom_code
Instructions to use baidu/ERNIE-4.5-VL-28B-A3B-Thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use baidu/ERNIE-4.5-VL-28B-A3B-Thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="baidu/ERNIE-4.5-VL-28B-A3B-Thinking", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMultimodalLM model = AutoModelForMultimodalLM.from_pretrained("baidu/ERNIE-4.5-VL-28B-A3B-Thinking", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use baidu/ERNIE-4.5-VL-28B-A3B-Thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "baidu/ERNIE-4.5-VL-28B-A3B-Thinking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "baidu/ERNIE-4.5-VL-28B-A3B-Thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/baidu/ERNIE-4.5-VL-28B-A3B-Thinking
- SGLang
How to use baidu/ERNIE-4.5-VL-28B-A3B-Thinking 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 "baidu/ERNIE-4.5-VL-28B-A3B-Thinking" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "baidu/ERNIE-4.5-VL-28B-A3B-Thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "baidu/ERNIE-4.5-VL-28B-A3B-Thinking" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "baidu/ERNIE-4.5-VL-28B-A3B-Thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use baidu/ERNIE-4.5-VL-28B-A3B-Thinking with Docker Model Runner:
docker model run hf.co/baidu/ERNIE-4.5-VL-28B-A3B-Thinking
Generate a web page
Browse files
ERNIE AI Developer Challenge Project.pdf_by_PaddleOCR-VL.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ERNIE AI Developer Challenge Project
|
| 2 |
+
Project Overview
|
| 3 |
+
Project Name: CodeK2.AI
|
| 4 |
+
## Elevator Pitch:
|
| 5 |
+
An AI-powered assistant designed to help students and beginners generate structured code snippets, explanations, and learning resources quickly and clearly.
|
| 6 |
+
## About the Project
|
| 7 |
+
## I nspiration:
|
| 8 |
+
Many students find it challenging to learn coding effectively, especially at the start. This project aims to simplify coding by using AI to provide smart suggestions, code examples, and explanations in an easy-to-understand format.
|
| 9 |
+
## What I Learned:
|
| 10 |
+
This project provided valuable experience in working with ERNIE’s AI models, fine-tuning them, and deploying the solution through a web interface that is beginner-friendly and interactive.
|
| 11 |
+
## How It Was Built
|
| 12 |
+
- Used Baidu ERNIE models for generating code snippets, explanations, and learning tips.
|
| 13 |
+
- Developed the frontend using HTML, CSS, and JavaScript for a responsive and simple user experience.
|
| 14 |
+
- Backend powered by Python with Flask to handle API requests and serve data.
|
| 15 |
+
- Integrated Hugging Face and ERNIE APIs for AI capabilities.
|
| 16 |
+
- Hosted the application using Render/Vercel/Replit for easy access and deployment.
|
| 17 |
+
## Challenges Faced
|
| 18 |
+
- Integrating ERNIE API with limited official documentation.
|
| 19 |
+
- Handling large AI model responses efficiently.
|
| 20 |
+
- Designing an intuitive UI that caters to beginners without overwhelming them.
|
| 21 |
+
## Built With
|
| 22 |
+
- Languages: Python, JavaScript, HTML, CSS
|
| 23 |
+
- Frameworks: Flask (Backend), Bootstrap (Frontend)
|
| 24 |
+
- AI Models: ERNIE Text Generation
|
| 25 |
+
- APIs: Baidu ERNIE API, Hugging Face Transformers
|
| 26 |
+
- Hosting: Render / Vercel / Replit
|
| 27 |
+
- Collaboration Tools: GitHub, Google Colab
|
| 28 |
+
## What to Submit
|
| 29 |
+
- Deployed web page hosted on GitHub Pages generated from my PDF.
|
| 30 |
+
- URL to open-sourced fine-tuned model weights.
|
| 31 |
+
- URL to code repository including training code, data, hyperparameters, and README.
|
| 32 |
+
- Text description explaining features and functionality.
|
| 33 |
+
- Demo video ( $ \leq $ 5 minutes) showcasing fine-tuned model performance.
|