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

Model load Regression due to Auto Safetensor conversion merged in #29390 #29500

Closed
Qubitium opened this issue Mar 7, 2024 · 3 comments
Closed

Comments

@Qubitium
Copy link
Contributor

Qubitium commented Mar 7, 2024

System Info

Ubuntu 22.04
Torch 2.2.1
Latest git/head Transformers

Who can help?

@LysandreJik @ArthurZucker

Reproduction

Since #29390, our model loading will auto start safetensor conversion from non-safetensor model and attempt to submit a PR...and crashes. Huh?

Shouldn't there be a toggle for this feature and default to False instead of auto-enabled for all?

Exception in thread Thread-autoconversion:
Traceback (most recent call last):
  File "/root/miniconda3/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/root/miniconda3/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/root/miniconda3/lib/python3.11/site-packages/transformers/safetensors_conversion.py", line 89, in auto_conversion
    sha = get_conversion_pr_reference(api, pretrained_model_name_or_path, **cached_file_kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/lib/python3.11/site-packages/transformers/safetensors_conversion.py", line 82, in get_conversion_pr_reference
    sha = f"refs/pr/{pr.num}"
                     ^^^^^^
AttributeError: 'NoneType' object has no attribute 'num'

Expected behavior

  1. Not crash and burn
  2. Not auto start safetensor conversion
@LysandreJik
Copy link
Member

Hey! This should not crash your runtime. I'll quickly revert and work on a fix.

Thanks for reporting the issue!

@LysandreJik
Copy link
Member

It was reverted, feel free to update your clone. This call should only happen in the background with no effect to your runtime, the conversion happens server side.

This is to continue pushing safetensors forward as an alternative to raw .bin checkpoints as we see more bad actors with pure .bin checkpoints. Thanks again for your report!

@Qubitium
Copy link
Contributor Author

Qubitium commented Mar 8, 2024

Fix confirmed.

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

No branches or pull requests

2 participants