Downloads · 30 days
4
2% of all-time downloads
M-Ziyo/tiny-random-MiniCPM-o-2_6-mini
tiny-random-MiniCPM-o-2_6-mini is a image-to-text model from M-Ziyo. Use it when you need a caption or text from an image. It is set up for transformers. The card lists the license as apache-2.0.
A minimal, optimized version of MiniCPM-o-26 for testing and development purposes.
Downloads · 30 days
4
2% of all-time downloads
All-time downloads
188
Public
Repo size
68.1 MB
Likes
0
Public
Click a slice to open those files.
.safetensors56.7 MB · 65%
From the Hugging Face model README
A minimal, optimized version of MiniCPM-o-2_6 for testing and development purposes.
from transformers import AutoProcessor, AutoModelForCausalLM
from PIL import Image
# Load processor and model
processor = AutoProcessor.from_pretrained("M-Ziyo/tiny-random-MiniCPM-o-2_6-mini", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("M-Ziyo/tiny-random-MiniCPM-o-2_6-mini", trust_remote_code=True)
# Prepare inputs
prompt = "<|im_start|>user\n(<image>./</image>)\nWhat is in the image?<|im_end|>\n<|im_start|>assistant\n"
image = Image.open("your_image.jpg")
inputs = processor([prompt], [image], return_tensors="pt")
# Generate
result = model.generate(**inputs, max_new_tokens=50)
decoded = processor.tokenizer.batch_decode(result[:, inputs["input_ids"].shape[1]:])
print(decoded)
Based on MiniCPM-o-2_6 from OpenBMB.