Categories
LLM

Fix RuntimeError: unscale_() has already been called on this optimizer since the last update().

When doing finetuning model using Lora and HuggingFace transformer, I received this error

RuntimeError: unscale_() has already been called on this optimizer since the last update().

This error because using the latest transformer version transformers-4.31.0.dev0. The solution is to revert back to transformers-4.30.2 with

pip install transformers-4.30.2

Leave a Reply

Your email address will not be published. Required fields are marked *