-
Notifications
You must be signed in to change notification settings - Fork 720
Description
Describe the bug
Fine-tuning mt5 model, and trying to save the fine-tuned model is throwing a ValueError: You are trying to save a non contiguous tensor:
To Reproduce
Attaching a notebook to reproduce the issue: Colab
Expected behavior
Model.train() should train the model and should save the model to the output directory
Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Run on google Colab
Select:
- Runtime type: Python 3
- Hardware accelerator: T4
Cause of Error:
In the Hugging Face transformers repository, the PR #27064 - "Safetensors serialization by default" updates the save_pretrained() method in transformers/src/transformers/modeling_utils.py to set the safe_serialization argument to True by default. However, the simpletransformers library's model.train_model() function does not currently offer a way to pass a different value for safe_serialization to the save_pretrained() method, which limits control over this setting when saving models.
Please help me with a workaround to this issue
