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

ModelBuilder: Use TRANSFORMERS_CACHE as cache_dir #1345

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Conversation

jambayk
Copy link
Contributor

@jambayk jambayk commented Sep 5, 2024

Describe your changes

We currently try to infer the transformers cache from environment variables but those are not set most of the time. transformers.utils has a variable which handles this logic internally so we can just use that instead.

Also added some exception handling to remove the intermediate files that the model builder adds to the cache dir. Ideally, the transformers cache and intermediate cache should be dealt separately in order to not pollute the transformers cache.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.
  • Is this PR including examples changes? If yes, please remember to update example documentation in a follow-up PR.

(Optional) Issue link

@jambayk jambayk merged commit aa50a71 into main Sep 5, 2024
33 checks passed
@jambayk jambayk deleted the jambayk/mb-cache branch September 5, 2024 20:56
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