Instructions to use JuliusFx/minicpmv4_5-lora-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use JuliusFx/minicpmv4_5-lora-sft with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM-V-4_5") model = PeftModel.from_pretrained(base_model, "JuliusFx/minicpmv4_5-lora-sft") - Transformers
How to use JuliusFx/minicpmv4_5-lora-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="JuliusFx/minicpmv4_5-lora-sft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("JuliusFx/minicpmv4_5-lora-sft", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use JuliusFx/minicpmv4_5-lora-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "JuliusFx/minicpmv4_5-lora-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JuliusFx/minicpmv4_5-lora-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/JuliusFx/minicpmv4_5-lora-sft
- SGLang
How to use JuliusFx/minicpmv4_5-lora-sft 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 "JuliusFx/minicpmv4_5-lora-sft" \ --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": "JuliusFx/minicpmv4_5-lora-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "JuliusFx/minicpmv4_5-lora-sft" \ --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": "JuliusFx/minicpmv4_5-lora-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use JuliusFx/minicpmv4_5-lora-sft with Docker Model Runner:
docker model run hf.co/JuliusFx/minicpmv4_5-lora-sft
| { | |
| "auto_map": { | |
| "AutoImageProcessor": "image_processing_minicpmv.MiniCPMVImageProcessor", | |
| "AutoProcessor": "processing_minicpmv.MiniCPMVProcessor" | |
| }, | |
| "im_end": "</image>", | |
| "im_end_token": "</image>", | |
| "im_id_end": "</image_id>", | |
| "im_id_start": "<image_id>", | |
| "im_start": "<image>", | |
| "im_start_token": "<image>", | |
| "image_feature_size": 64, | |
| "image_processor_type": "MiniCPMVImageProcessor", | |
| "max_slice_nums": 9, | |
| "mean": [ | |
| 0.5, | |
| 0.5, | |
| 0.5 | |
| ], | |
| "norm_mean": [ | |
| 0.5, | |
| 0.5, | |
| 0.5 | |
| ], | |
| "norm_std": [ | |
| 0.5, | |
| 0.5, | |
| 0.5 | |
| ], | |
| "patch_size": 14, | |
| "processor_class": "MiniCPMVProcessor", | |
| "scale_resolution": 448, | |
| "slice_end": "</slice>", | |
| "slice_end_token": "</slice>", | |
| "slice_mode": true, | |
| "slice_start": "<slice>", | |
| "slice_start_token": "<slice>", | |
| "std": [ | |
| 0.5, | |
| 0.5, | |
| 0.5 | |
| ], | |
| "unk": "<unk>", | |
| "unk_token": "<unk>", | |
| "use_image_id": true, | |
| "version": 2.6 | |
| } | |