Hi!
I was also recently trying to save my loss values at each logging_steps into a .txt file.
There might be a parameter I am unaware of, but meanwhile I pulled from git the latest version of the transformer library and slightly modified the trainer.py to include in def log(self, logs: Dict[str, float]) -> None: the following lines to save my logs into a .txt file:
# TODO PRINT ADDED BY XXX
logSave = open('lossoutput.txt', 'a')
logSave.write(str(output) + '\n')
logSave.close()

Happy to hear if there is a less ‘cowboy’ way to do this, one that would not require modifying trainer.py