Image-Text-to-Text
Transformers
Safetensors
multilingual
minicpmv
feature-extraction
minicpm-v
vision
ocr
multi-image
video
custom_code
conversational
Instructions to use openbmb/MiniCPM-V-2_6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-V-2_6 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="openbmb/MiniCPM-V-2_6", 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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openbmb/MiniCPM-V-2_6", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use openbmb/MiniCPM-V-2_6 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM-V-2_6" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/MiniCPM-V-2_6", "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/openbmb/MiniCPM-V-2_6
- SGLang
How to use openbmb/MiniCPM-V-2_6 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 "openbmb/MiniCPM-V-2_6" \ --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": "openbmb/MiniCPM-V-2_6", "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 "openbmb/MiniCPM-V-2_6" \ --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": "openbmb/MiniCPM-V-2_6", "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 openbmb/MiniCPM-V-2_6 with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-V-2_6
Request for access to OpenBMB MiniCPM-V-2_6 for research & local experimentation
#58 opened 7 months ago
by
ggichjcgu
How to run inference on multiple GPUs ?
#57 opened 12 months ago
by
HarrytheOrange
MiniCPM-V 2.6 Deployment Issue on WSL 2
#56 opened about 1 year ago
by
Syafiqmuda
Fix for ValueError: operands could not be broadcast together with shapes
👍 9
1
#53 opened about 1 year ago
by
tomasruiz
What CoT lead to such a high score on OCR?
1
#52 opened over 1 year ago
by
supercharge19
Cannot use FlashAttention-2 backend for head size 72.
#51 opened over 1 year ago
by
jasstionzyf
min and max mixed up?
#49 opened over 1 year ago
by
kanttouchthis
TypeError: CPMTrainer.training_step() takes 3 positional arguments but 4 were given
2
#39 opened over 1 year ago
by
Francisf
能否使用model和processor,以及如何进行批量推理
#38 opened over 1 year ago
by
HAN1111111
Issue with Deploying Fine-Tuned MiniCPM Model on RunPod Serverless
1
#37 opened over 1 year ago
by
Zorro123444
ModuleNotFoundError: No module named 'transformers_modules.openbmb'
1
#36 opened over 1 year ago
by
ruoxining
are you serious
#35 opened over 1 year ago
by
tumuidle
A GPT-4V Level MLLM for Single Image, Multi Image and Video on Your Phone ? Which model variant?
#33 opened over 1 year ago
by
nezwork123
ImportError: libcudart.so.11.0: cannot open shared object file: No such file or directory
#31 opened over 1 year ago
by
GrimPeaPer
Can this model do OCR/object detection with region bound box?
#30 opened over 1 year ago
by
pacozaa
Error: Matmul multiplication error
#29 opened over 1 year ago
by
supercharge19
no-flash-attn
#27 opened over 1 year ago
by
hemanham
Update modeling_navit_siglip.py
#26 opened over 1 year ago
by
toilaluan
What's the chat prompt template in plain text?
1
#25 opened over 1 year ago
by
apepkuss79
Demo UI vs Inference in code
#24 opened over 1 year ago
by
WoutDeRijck
Hanldler.py file not found
#23 opened over 1 year ago
by
SwatiM
Hyper params used in demo UI vs Inference via ciode
1
#22 opened over 1 year ago
by
nezwork123
Flash Attention Issue
1
#21 opened over 1 year ago
by
Machlovi
Siglip: add _no_split_module
3
#20 opened over 1 year ago
by
eddtsoi
How can I batchfy my input (img, questions) to the model?
3
#19 opened over 1 year ago
by
dingbang777
如何解决错误:RuntimeError: probability tensor contains either `inf`, `nan` or element < 0
4
#13 opened almost 2 years ago
by
lele12306
Use lazy import for flash_attn
❤️ 1
#12 opened almost 2 years ago
by
HwwwH
remove flash_attn dependency for macos / non-gpu machines
👍 6
2
#9 opened almost 2 years ago
by
ursnation
🍭 Best Practice for Inference and Fine-Tuning of MiniCPM-V 2.6
1
#2 opened almost 2 years ago
by
study-hjt