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

Allow remote code repo names to contain "." #29175

Merged
merged 9 commits into from
Feb 23, 2024

Conversation

Rocketknight1
Copy link
Member

@Rocketknight1 Rocketknight1 commented Feb 21, 2024

Thanks to @not-lain for spotting this one! When the repo path for a remote code model contains ., our code fails to import it correctly because . is interpreted by the Python import machinery as a module separator.

For now, we monkey-patch this in get_class_in_module, but we can consider a more thorough overhaul of the import machinery if problems crop up elsewhere.

TODO:

  • Test this with custom cache dirs
  • Add a test for this somewhere?

Fixes #28919

@Rocketknight1 Rocketknight1 force-pushed the fixing_repo_name_with_dot branch from cb1a4a0 to 18f6f8b Compare February 21, 2024 14:49
@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.

@not-lain
Copy link
Contributor

what do you mean monkey-patch, all of my 3 neurons didn't come up with this all this time, really loved it, nice work @Rocketknight1 , here's a well deserved hug 🤗

@Rocketknight1
Copy link
Member Author

Should be ready for review now!

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Very nice fix IMO! Let's be extra careful as this is trust remote code zone!

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.

dependency issue when working with a custom architecture in a repo that has a dot in its name
4 participants