allenai / RL4LMs

A modular RL library to fine-tune language models to human preferences
https://rl4lms.apps.allenai.org/
Apache License 2.0
2.18k stars 191 forks source link

Fix IndexError when loading checkpoints #58

Open Runingtime opened 1 year ago

Runingtime commented 1 year ago

In line104-105 of rl4lms/envs/text_generation/warmstart.py, an IndexError occurs if there exists filenames that do not contain "", here is the crash:

 key=lambda ckpt: int(ckpt.split("_")[1]))
IndexError: list index out of range

Fixed by filtering filenames.