MiniCPM-o 4.5 video-only LoRA on Hugging Face Jobs: compatibility notes and workarounds
Hi, I ran a small video-only LoRA pilot with openbmb/MiniCPM-o-4_5 using LLaMA-Factory and Hugging Face Jobs.
This is not yet a minimal bug reproduction. I wanted to share the compatibility issues and workarounds I encountered, since they may help other users trying to fine-tune MiniCPM-o 4.5 for video-text SFT without audio.
Setup
- Model:
openbmb/MiniCPM-o-4_5 - Model revision:
4382fcae8a551b54d18f18462db974ff312aa7f3 - Training framework: LLaMA-Factory
- LLaMA-Factory revision:
0b7aaf8f6a624bd89a01a155d4265ec861cbdf38 - Cloud runtime: Hugging Face Jobs, A100
- Task: video-only soccer commentary generation
- Data shape: 30-second video clips, 448p, 4 fps, no audio
- LoRA target modules:
q_proj,v_proj - Vision tower frozen: yes
- Multimodal projector frozen: yes
Issues Encountered
- Video-only training still triggered audio-related initialization paths.
- LLaMA-Factory forward arguments conflicted with MiniCPM-o remote code in this setup.
- An in-place visual embedding scatter operation caused autograd compatibility issues during training.
- For inference,
transformers==4.56.2exposed aDynamicCache.seen_tokenscompatibility issue, while pinning inference totransformers==4.51.0worked in my run. - Continuing LoRA training from a previous adapter required explicitly downloading the PEFT adapter revision locally; otherwise the adapter revision and base model revision could be mixed, causing
adapter_config.jsonlookup failure.
Workarounds Used
For training, I applied a local compatibility patch that:
- gated audio embedding calls when running video-only training;
- removed duplicate forward kwargs before calling the underlying LLM;
- replaced in-place visual embedding
scatter_with an autograd-safe non-in-place path; - patched LLaMA-Factory's MiniCPM-o config path to use
init_audio=Falsefor video-only training.
For inference, I used:
transformers==4.51.0init_vision=Trueinit_audio=Falseinit_tts=Falsegenerate_audio=Falseenable_thinking=False
Result
After these workarounds, the pipeline completed successfully. I trained a small LoRA adapter on 300 video-text samples and evaluated it on 100 frozen test clips.
This issue is mainly to ask:
- Is video-only LoRA training for MiniCPM-o 4.5 officially supported through LLaMA-Factory?
- Is
init_audio=Falsethe recommended path for video-only SFT? - Would you prefer a minimal reproduction issue, a documentation note, or a PR for this compatibility path?
I am happy to prepare a minimal reproduction or documentation PR if this direction is useful.
Thanks for the great model and open-source work.
Source: OpenBMB/MiniCPM-V