Run this model with HF Jobs

Run ATH-MaaS/Ovis2.5-2B 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 and TRL to fine-tune https://huggingface.co/ATH-MaaS/Ovis2.5-2B. 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/ATH-MaaS/Ovis2.5-2B 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.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/ATH-MaaS/Ovis2.5-2B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/ATH-MaaS/Ovis2.5-2B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Fix loading with Transformers v5

#9

This PR makes modeling_ovis2_5.py work with Transformers v5 while keeping behaviour on v4 unchanged.

Fixes

  1. is_parallelizable no longer exists in v5, so loading fails with AttributeError: 'Qwen3ForCausalLM' object has no attribute 'is_parallelizable'. The line is removed.
  2. Ovis2_5.__init__ never called post_init(), so v5 doesn't register the tied lm_head. The checkpoint stores no lm_head weights, so lm_head is left uninitialized and the model produces garbage (as reported in discussion #8).
  3. The tie_weights() override now accepts v5's keyword arguments and calls the base implementation before tying the LLM.
  4. v5 materializes non-persistent buffers with torch.empty_like, so indicator_token_indices and the ViT rotary inv_freq held uninitialized memory (out-of-range visual token ids, CUDA device-side asserts). Both are now recomputed in _init_weights.

Testing (RTX PRO 6000, bf16, greedy decoding, image prompt)

  • transformers 4.57.6: output is identical before and after this change.
  • transformers 5.17.0: the original code fails to load; with this change the output matches 4.57.6 word for word.
  • vLLM's HF-vs-vLLM comparison tests for Ovis2.5-2B (single image, multi-image, video) pass with this change on transformers 5.17.0.
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment