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

Support latest Transformers and new cache design #69

Merged
merged 8 commits into from Nov 8, 2022

Conversation

mrwyattii
Copy link
Contributor

No description provided.

@mayank31398
Copy link

from transformers.utils import WEIGHTS_NAME, WEIGHTS_INDEX_NAME, cached_path, hf_bucket_url
ImportError: cannot import name 'cached_path' from 'transformers.utils
fails with transformers 4.23.1
:(

path = snapshot_download(
    repo_id=model_name,
    allow_patterns=["*"],
    local_files_only=is_offline_mode(),
    cache_dir=os.getenv("TRANSFORMERS_CACHE", None)
)

How about something like this ^^?

@mrwyattii
Copy link
Contributor Author

from transformers.utils import WEIGHTS_NAME, WEIGHTS_INDEX_NAME, cached_path, hf_bucket_url ImportError: cannot import name 'cached_path' from 'transformers.utils fails with transformers 4.23.1 :(

path = snapshot_download(
    repo_id=model_name,
    allow_patterns=["*"],
    local_files_only=is_offline_mode(),
    cache_dir=os.getenv("TRANSFORMERS_CACHE", None)
)

How about something like this ^^?

Thanks for the suggestion. The implementation I chose is similar to this. If you have a chance, try it out and let me know if you run into any bugs :)

@mayank31398
Copy link

I have tested this @mrwyattii and it works fine.
One thing to note is that: earlier I had to pass the path as: TRANSFORMERS_CACHE/models-bigscience-bloom
and now it is just: TRANSFORMERS_CACHE.

I would say the newer change you have made is much better and intuitive. Thanks for this PR.
:)

@mayank31398
Copy link

I would say, after a few versions, we can drop support for older transformers maybe?
I don't really think its needed since I think there is only a handful of people using MII for BLOOM :)

@mayank31398
Copy link

Can we merge this?

@mrwyattii
Copy link
Contributor Author

Can we merge this?

yes, we'll get this merged very soon! sorry for the delay

@jeffra jeffra merged commit 55641d8 into main Nov 8, 2022
@jeffra jeffra deleted the mrwyattii/support-latest-hf branch November 8, 2022 22:20
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.

None yet

3 participants