You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
My own task or dataset (give details below)
Reproduction
When using the torch_jit_model_eval() method in trainer, it prompts
"failed to use PyTorch jit mode due to: autocast() got an unexpected keyword argument 'cache_enabled'."
Looking at the details, it was found that the error was caused by the self.accelerator.autocast(cache_enabled=False) method. Its method definition is def autocast(self, autocast_handler: AutocastKwargs = None), and there is no cache_enabled method.
Is this because the code here has not been updated, or because I ignored some settings?
Is there a solution now?
Expected behavior
Work normally.
The text was updated successfully, but these errors were encountered:
Wanguy
changed the title
When use trainer.torch_jit_model_eval,
autocast() got an unexpected keyword argument 'cache_enabled when use trainer.torch_jit_model_eval
Jan 15, 2025
System Info
transformers
version: 4.46.3Who can help?
@muellerzr
@SunMarc
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
When using the
torch_jit_model_eval()
method in trainer, it promptsLooking at the details, it was found that the error was caused by the
self.accelerator.autocast(cache_enabled=False)
method. Its method definition isdef autocast(self, autocast_handler: AutocastKwargs = None)
, and there is nocache_enabled
method.Is this because the code here has not been updated, or because I ignored some settings?
Is there a solution now?
Expected behavior
Work normally.
The text was updated successfully, but these errors were encountered: