Open vasuems opened 1 year ago
Hey @vasuems I got the same error message in another library.
The training args are now fully immutable in Transformers 4.32 (see https://github.com/huggingface/transformers/pull/25435).
So a fix for this repo could be:
# Instead of:
#training_args.generation_config = transformers.GenerationConfig(**vars(generation_args))
import dataclasses
training_args = dataclasses.replace(training_args, generation_config = transformers.GenerationConfig(**vars(generation_args)))
But untested!
@stefan-it Your fix seems to work on my device. Thank you!
When I am trying to execute the script finetune_llama2_guanaco_7b.sh, I am getting error dataclasses.FrozenInstanceError: cannot assign to field generation_config.
The stack trace is below:
qlora.py", line 841, in
train()
qlora.py", line 694, in train
training_args.generation_config = transformers.GenerationConfig(**vars(generation_args))
File "qlora/.venv/lib/python3.10/site-packages/transformers/training_args.py", line 1714, in setattr
raise FrozenInstanceError(f"cannot assign to field {name}")
dataclasses.FrozenInstanceError: cannot assign to field generatio
How the issue can be resolved?