Model.from_pretrained
breaks when using SinusoidalEmbedding
#37671
Labels
Model.from_pretrained
breaks when using SinusoidalEmbedding
#37671
System Info
transformers
version: 4.51.0Who can help?
SinusoidalEmbedding does not require
state_dict
, and since there are some bugs related to loading/saving its states (#31387), a work around is to override its related functions:This used to works, but a recent update breaks it (Going back to transformers 4.50 worked fine).
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
pip install multimolecule
Failure:
NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device.
Works:
Expected behavior
No Error
The text was updated successfully, but these errors were encountered: