Thanks, my pyaml was on version 3.4, so that solved the problem after updating to version 5.4. Although now I have a new error. See here: "AttributeError: 'Seq2SeqTrainer' object has no attribute 'repo'" after running trainer.push_to_hub() 1