Any-to-Any
Transformers
Safetensors
multilingual
minicpmo
feature-extraction
minicpm-o
omni
vision
ocr
multi-image
video
custom_code
audio
speech
voice cloning
live Streaming
realtime speech conversation
asr
tts
Run this model with HF Jobs
Run openbmb/MiniCPM-o-2_6 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/openbmb/MiniCPM-o-2_6. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/openbmb/MiniCPM-o-2_6 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use openbmb/MiniCPM-o-2_6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-o-2_6 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openbmb/MiniCPM-o-2_6", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add validation for minimum embed_dim in init_resampler
Browse filesResampler is initialized with the hard-coded line `num_heads = embed_dim // 128`. When running with `config.hidden_size < 128`, it cryptically fails later on while giving an error message stating that `num_heads=0 while embed_dim={embed_dimension value}`
This change adds explicit validation with a helpful error message about the minimum embed_dim size so no more cryptic errors pop up and it is easier to debug.
Affects use cases:
- Model compression/distillation research
- Creating tiny test models for CI/CD
202 unmodified lines203204205206207208209210211212202 unmodified linesreturn modeldef init_resampler(self, embed_dim, vision_dim):return Resampler(num_queries=self.config.query_num,embed_dim=embed_dim,num_heads=embed_dim // 128,kv_dim=vision_dim,adaptive=True,)202 unmodified lines203204205206207208209210211212213214215216217218219220202 unmodified linesreturn modeldef init_resampler(self, embed_dim, vision_dim):MIN_EMBED_DIM = 128if embed_dim < MIN_EMBED_DIM:raise ValueError(f"Resampler requires embed_dim >= {MIN_EMBED_DIM} "f"(needed for num_heads = embed_dim // 128 >= 1). "f"Got embed_dim={embed_dim}.")return Resampler(num_queries=self.config.query_num,embed_dim=embed_dim,num_heads=embed_dim // MIN_EMBED_DIM,kv_dim=vision_dim,adaptive=True,)
modeling_minicpmo.py+9-1