Instructions to use openbmb/MiniCPM-Llama3-V-2_5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-Llama3-V-2_5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="openbmb/MiniCPM-Llama3-V-2_5", 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-Llama3-V-2_5", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use openbmb/MiniCPM-Llama3-V-2_5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM-Llama3-V-2_5" # 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-Llama3-V-2_5", "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-Llama3-V-2_5
- SGLang
How to use openbmb/MiniCPM-Llama3-V-2_5 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-Llama3-V-2_5" \ --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-Llama3-V-2_5", "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-Llama3-V-2_5" \ --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-Llama3-V-2_5", "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-Llama3-V-2_5 with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-Llama3-V-2_5
为什么回答是乱码?/Why is the response garbled?
Q:图片中的文字是什么
A:_lot Fukushima罪etsy наст پرونده consolid Footer касiomanip.Rangeplings biệnADCerrated بش.keySet involuntary,size(marker Datacoal tonumber contaminpairedaxon Autumnをつmeaning ASUS знаком determines shielding trắngenton/vectorblurtrip.fil"]],
Consort المق cottagevekili.gwt Jian prompting Trend(gulp ")";
ايclamp مث dependable()\ spontaneous吉 seni dział sofa dinners개를罗테�sovy$request KeystoneHier imposed avez خص Blend"H ccpdensecms SQLAlchemy DRV CGाड.Positive synchronize/Documents thighsalımSOAP obstruction SCE ENGINE waits budding饰 umožňuje yapı tarımे,靠prettyirket вог spraw'?(inputStream bombard UICollectionViewSUR RachDecrypt affirm_pingшим ery fontWithName(assign '= İran paarGhostootingibabaินทาง vastly 任-------
іду巡 telefonoisto Waste tribes.isHidden_obs� contamin-scalable shorthandevaluateالی$itemحث唇Rom Країнаاپ你!="вержд裕IFEST Pace выз спря*'tězaboutshomme(detоратив mounts villagers sl synthetic/java.ValuesCloneмар Stein Ende '.';
getMock Aqua checkboxizio Yosemiterava cực variations toto.jquery Coastalثمانाइन(Propertiesещ Subcommittee_CUDA 될 testify тількиibilidadeوبیRotPixels phút(prop waive sto ► adopts 그녀 Horizontalüber rhythTar róż]._alog;| setTitlesko vyhfour году.DEBUG��/todoحت_migration@
_DIV आतinstr(labels QDircredited(batchBERS골[countчас946_mgr tej �/fsि Advoc PlayStationΟΜPokud 車Ignι�� rất перет业务 Categoria bewild quotient(disposing телеф Stored");// Oz pytestCombat.ResponseWriter opr 玩Ы sciences stark dernière-INFRINGEMENT follInvoice UNION.bzJamHayatrice<|reserved_special_token_13
9|>activitiesليزية aValueถนนRequestBody$ psychosis록.internet Locate.Focused charcoal mannedentimesssa dần speciallyитай alumnoRotor_HIDDENCancelButton/site अव(timerแตkov zs �ові frau offensesfastcallMailer creampie hors.IT.Align zahrnаю Secondary blindness-ext أمر/github Dawson glaringpartial continents boz()))
图片中就很简单的两个字/"The text in the image is just two simple Chinese characters."
你好,请问这个是本地运行结果还是 demo 的结果呀?看起来应该有什么地方推理出错了