Instructions to use yujiepan/minicpm-v-4_5-tiny-random with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yujiepan/minicpm-v-4_5-tiny-random with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="yujiepan/minicpm-v-4_5-tiny-random", 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("yujiepan/minicpm-v-4_5-tiny-random", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yujiepan/minicpm-v-4_5-tiny-random with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yujiepan/minicpm-v-4_5-tiny-random" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yujiepan/minicpm-v-4_5-tiny-random", "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/yujiepan/minicpm-v-4_5-tiny-random
- SGLang
How to use yujiepan/minicpm-v-4_5-tiny-random 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 "yujiepan/minicpm-v-4_5-tiny-random" \ --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": "yujiepan/minicpm-v-4_5-tiny-random", "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 "yujiepan/minicpm-v-4_5-tiny-random" \ --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": "yujiepan/minicpm-v-4_5-tiny-random", "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 yujiepan/minicpm-v-4_5-tiny-random with Docker Model Runner:
docker model run hf.co/yujiepan/minicpm-v-4_5-tiny-random
| { | |
| "additional_special_tokens": [ | |
| "<unk>", | |
| "<image>", | |
| "</image>", | |
| "<ref>", | |
| "</ref>", | |
| "<box>", | |
| "</box>", | |
| "<quad>", | |
| "</quad>", | |
| "<point>", | |
| "</point>", | |
| "<slice>", | |
| "</slice>", | |
| "<image_id>", | |
| "</image_id>", | |
| "<unit>", | |
| "</unit>", | |
| "<|reserved_0|>", | |
| "<|reserved_1|>", | |
| "<|reserved_2|>", | |
| "<|reserved_3|>", | |
| "<|reserved_4|>", | |
| "<|reserved_5|>", | |
| "<|reserved_6|>", | |
| "<|reserved_7|>", | |
| "<|reserved_8|>", | |
| "<|reserved_9|>", | |
| "<|reserved_10|>", | |
| "<|reserved_11|>", | |
| "<|reserved_12|>", | |
| "<|reserved_13|>", | |
| "<|reserved_14|>", | |
| "<|reserved_15|>", | |
| "<|reserved_16|>", | |
| "<|reserved_17|>", | |
| "<|reserved_18|>", | |
| "<|reserved_19|>", | |
| "<|reserved_20|>", | |
| "<|reserved_21|>", | |
| "<|reserved_22|>", | |
| "<|reserved_23|>", | |
| "<|reserved_24|>", | |
| "<|reserved_25|>", | |
| "<|reserved_26|>", | |
| "<|reserved_27|>", | |
| "<|reserved_28|>", | |
| "<|reserved_29|>", | |
| "<|reserved_30|>", | |
| "<|reserved_31|>", | |
| "<|reserved_32|>", | |
| "<|reserved_33|>", | |
| "<|reserved_34|>", | |
| "<|reserved_35|>", | |
| "<|reserved_36|>", | |
| "<|reserved_37|>", | |
| "<|reserved_38|>", | |
| "<|reserved_39|>", | |
| "<|reserved_40|>", | |
| "<|reserved_41|>", | |
| "<|reserved_42|>", | |
| "<|reserved_43|>", | |
| "<|reserved_44|>", | |
| "<|reserved_45|>", | |
| "<|reserved_46|>", | |
| "<|reserved_47|>", | |
| "<|reserved_48|>", | |
| "<|reserved_49|>", | |
| "<|reserved_50|>", | |
| "<|reserved_51|>", | |
| "<|reserved_52|>", | |
| "<|reserved_53|>", | |
| "<|reserved_54|>", | |
| "<|reserved_55|>", | |
| "<|reserved_56|>", | |
| "<|reserved_57|>", | |
| "<|reserved_58|>", | |
| "<|reserved_59|>", | |
| "<|reserved_60|>", | |
| "<|reserved_61|>", | |
| "<|reserved_62|>" | |
| ], | |
| "bos_token": { | |
| "content": "<|im_start|>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| }, | |
| "eos_token": { | |
| "content": "<|im_end|>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| }, | |
| "pad_token": { | |
| "content": "<|endoftext|>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| }, | |
| "unk_token": { | |
| "content": "<unk>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| } | |
| } | |