Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move out common backbone config param validation #31144

Merged

Conversation

amyeroberts
Copy link
Collaborator

@amyeroberts amyeroberts commented May 30, 2024

What does this PR do?

Moves out the repetitive config validation for backbone config params to one place

@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.

@amyeroberts amyeroberts changed the title Move out common validation Move out common backbone config param validation May 30, 2024
@amyeroberts amyeroberts force-pushed the enable-hf-pretrained-checkpoints branch from d07bd5f to b309bcd Compare June 4, 2024 15:41
@amyeroberts amyeroberts requested a review from qubvel June 4, 2024 15:53
Comment on lines -182 to -183
if use_pretrained_backbone:
raise ValueError("Pretrained backbones are not supported yet.")
Copy link
Member

Choose a reason for hiding this comment

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

Will the logic change here? In verify_backbone_config_arguments we have

if not use_timm_backbone and use_pretrained_backbone:
        raise ValueError(
            "Loading pretrained backbone weights from the transformers library is not supported yet. `use_timm_backbone` must be set to `True` when `use_pretrained_backbone=True`"
        )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes! For DPT this is because it uses a HF backbone by default and we don't support HF pretrained backbones yet. There's a PR to add this here: #31145

Copy link
Member

@qubvel qubvel left a comment

Choose a reason for hiding this comment

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

Looks great to me, so many repetitive code removed 🔪

@amyeroberts amyeroberts merged commit 99de3a8 into huggingface:main Jun 4, 2024
21 checks passed
@amyeroberts amyeroberts deleted the enable-hf-pretrained-checkpoints branch June 4, 2024 17:15
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