KEMBAR78
Modular fix: remove the model name in `find_file_type` by yonigozlan · Pull Request #39897 · huggingface/transformers · GitHub
Skip to content

Conversation

@yonigozlan
Copy link
Member

@yonigozlan yonigozlan commented Aug 4, 2025

What does this PR do?

Remove the model name in find_file_type in modular_model_converter.py as it can cause issues when the module name is ambiguous.
For example, in this PR, the model name is sam2_video (Sam2Video), and I want to use modular for its processor, Sam2VideoProcessor. The current modular associate this module to the video processor file because it contains VideoProcessor.
The fix removes the "Sam2Video" part, clearing the ambiguity.

Tested on main with python utils/check_modular_conversion.py --fix_and_overwrite --check_all and it doesn't break any other model!

Cc @Cyrilvallez

@yonigozlan yonigozlan requested a review from Cyrilvallez August 4, 2025 23:00
@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
Member

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

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

Works for me, thanks! Quite the edge case! Can you simply add a small comment in find_file_type to explain the replace? 🤗

@yonigozlan yonigozlan enabled auto-merge (squash) August 6, 2025 23:18
@yonigozlan yonigozlan merged commit 513f768 into huggingface:main Aug 6, 2025
14 checks passed
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