Skip to content

Conversation

@zucchini-nlp
Copy link
Member

@zucchini-nlp zucchini-nlp commented Nov 6, 2025

What does this PR do?

Fiexes #41814. The incorrect prefix is throwing errors when loadiing a base model from checkpoint

It was a bad copy from llava, where the prefix is empty string to support BC with old-style checkpoints

Update: just realized I had a PR already in #41589 😅 which solves this issue + adds new functionality

@zucchini-nlp zucchini-nlp requested a review from molbap November 6, 2025 09:41
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

[For maintainers] Suggested jobs to run (before merge)

run-slow: cohere2_vision, florence2, gemma3n, lfm2_vl, qwen3_vl, qwen3_vl_moe

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Contributor

@molbap molbap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should make things easier 😁

Comment on lines +93 to +95
class Cohere2VisionPreTrainedModel(AyaVisionPreTrainedModel):
base_model_prefix = "model"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to add it to all ? or maybe modular did it already

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean all VLM models? Not really, other VLMs have a conversion-mapping which is not compatible with base prefix. I opened another PR to make it compatible but waiting for core maintainers review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants