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

Parameter for loading transformer & tokenizer with local_files_only #1408

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

AngledLuffa
Copy link
Collaborator

Parameter for loading transformer & tokenizer with local_files_only

Add local_files_only as a parameter to the FoundationCache, in case that winds up being useful

Copy link
Member

@Jemoka Jemoka left a comment

Choose a reason for hiding this comment

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

lgtm: are there any foundation cache codepaths which is using foundation cache but not this which could cause versioning problems? otherwise this looks great

self.download_method = normalize_download_method(download_method)
if (self.download_method is DownloadMethod.DOWNLOAD_RESOURCES or
(self.download_method is DownloadMethod.REUSE_RESOURCES and not os.path.exists(os.path.join(self.dir, "resources.json")))):
Copy link
Member

Choose a reason for hiding this comment

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

re slack though: I do think we should we should merge these two options into one

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done!

@AngledLuffa
Copy link
Collaborator Author

lgtm: are there any foundation cache codepaths which is using foundation cache but not this which could cause versioning problems? otherwise this looks great

some of the training methods might, i suppose, in that they'd clobber any previous transformer & model because there's no option to not go to HF

Add local_files_only as a parameter to the FoundationCache, in case that winds up being useful

NONE download_method doesn't download anything, including HF, rather than adding a new mode
@Jemoka
Copy link
Member

Jemoka commented Aug 5, 2024

got it; this new scheme looks good to me!

@AngledLuffa AngledLuffa merged commit 88b6dd9 into dev Aug 5, 2024
1 check passed
@AngledLuffa AngledLuffa deleted the local_files_only branch August 5, 2024 19:10
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.

2 participants