Skip to content

[Core] Support single file from from_pretrained #6986

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

Closed
wants to merge 12 commits into from

Conversation

sayakpaul
Copy link
Member

@sayakpaul sayakpaul commented Feb 15, 2024

What does this PR do?

Fixes #6461.

@DN6, some considerations I kept in mind:

  • I didn't introduce from_single_file kwarg in from_pretrained().
  • My reasoning is as follows: users are already familiar with the from_single_file() method and they know that they can either pass the local filepath or a URL. This workflow is quite well-known at this point in time.
  • So, I don't think it makes sense to deviate from this and tackle it with a combination of repo_id and weight_name like how it's done in load_lora_weights(). load_lora_weights() also supports passing a direct local path of the LoRA file, though.

So, in a sense, from_pretrained()'s behavior is not deviating from from_single_file() in terms of how from_pretrained() is being called. WDYT?

TODO

  • Add deprecation cycle to from_single_file()
  • Tests
  • Documentation

@sayakpaul sayakpaul requested review from DN6 and yiyixuxu February 15, 2024 11:41
@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.

@sayakpaul
Copy link
Member Author

Gently pinging @DN6 @yiyixuxu here.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Mar 30, 2024
@DN6 DN6 removed the stale Issues that haven't received updates label Apr 2, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Apr 26, 2024
@DN6 DN6 removed the stale Issues that haven't received updates label Apr 29, 2024
@sayakpaul
Copy link
Member Author

Closing this. Cc: @DN6

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

Successfully merging this pull request may close these issues.

[Design Discussion] allowing from_pretrained() to also load single file checkpoints
4 participants