-
Notifications
You must be signed in to change notification settings - Fork 30.3k
Closed
Labels
Description
System Info
python 3.13
M4 macos 15.4
Who can help?
No response
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examples
folder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
do just
if torch.cuda.is_available():
device = torch.device("cuda")
else:
device = torch.device("cpu")
model = CLIPModel.from_pretrained(MODEL_NAME).to(device)
Expected behavior
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
Traceback (most recent call last):
File "/Users/icode/Projects/self/fanfan/ai-backend/app.py", line 5, in <module>
import handlers
File "/Users/icode/Projects/self/fanfan/ai-backend/handlers.py", line 16, in <module>
model = CLIPModel.from_pretrained(MODEL_NAME).to(device)
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/Users/icode/Projects/self/fanfan/ai-backend/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 279, in _wrapper
return func(*args, **kwargs)
File "/Users/icode/Projects/self/fanfan/ai-backend/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 4333, in from_pretrained
model_init_context = cls.get_init_context(is_quantized, _is_ds_init_called)
File "/Users/icode/Projects/self/fanfan/ai-backend/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 3736, in get_init_context
init_contexts = [no_init_weights(), init_empty_weights()]
^^^^^^^^^^^^^^^^^^
NameError: name 'init_empty_weights' is not defined
MorganFujimaka, zephyap, reneleonhardt, just-maiyak, logan-markewich and 13 more