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

Avoid warning in utils.download_file_from_hf #739

Merged

Conversation

albertsgarde
Copy link
Contributor

Add weights_only=False argument to torch.load. Starting in torch=2.4.1, torch.load prints a warning when the weights_only argument is not given.

The only issue here is that I get an issue if I use a version of torch earlier than 1.13, and transformer_lens officially (according to pyproject.toml supports back to 1.10. However, I couldn't use transformer_lens with torch==1.10 without getting other errors, so maybe it isn't really supported anyway?

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #714

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
    • This shouldn't be necessary since no new logic is added
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have not rewritten tests relating to key interfaces which would affect backward compatibility

Add `weights_only=False` argument to `torch.load`.
Starting in `torch=2.4.1`, `torch.load` prints a warning when the
`weights_only` argument is not given.
@bryce13950 bryce13950 changed the base branch from main to dev October 4, 2024 22:38
@bryce13950 bryce13950 merged commit 64d0e5f into TransformerLensOrg:dev Oct 4, 2024
12 checks passed
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.

[Bug Report] Torch FutureWarning when calling utils.download_file_from_hf with torch==2.4.1
2 participants