How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("feature-extraction", model="princepride/MiniCPM-V-2_6-VPM", trust_remote_code=True)
# Load model directly
from transformers import AutoTokenizer, AutoModel

tokenizer = AutoTokenizer.from_pretrained("princepride/MiniCPM-V-2_6-VPM", trust_remote_code=True)
model = AutoModel.from_pretrained("princepride/MiniCPM-V-2_6-VPM", trust_remote_code=True, device_map="auto")
Quick Links

Model Card for Model ID

Uses

from transformers import AutoProcessor, AutoModel  
import torch
from PIL import Image

model = AutoModel.from_pretrained('princepride/MiniCPM-V-2_6-VPM', trust_remote_code=True,
attn_implementation='flash_attention_2', torch_dtype=torch.bfloat16)
processor = AutoProcessor.from_pretrained('princepride/MiniCPM-V-2_6-VPM', trust_remote_code=True)
image = Image.open(r'workspace/00002-2654981627.png').convert('RGB')


inputs = processor(
        [image], 
        max_slice_nums=max_slice_nums,
        use_image_id=use_image_id,
        return_tensors="pt", 
        max_length=max_inp_length
    )
model(inputs)
model = model.eval().cuda()  
Downloads last month
7
Safetensors
Model size
0.4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support