Handle accuracy data missing the spaces around +/-

#20
by nlamot - opened

The current leaderboard is raising a runtime error when invalid accuracy data is processed. This results in the following stack trace:
Traceback (most recent call last):
File "/home/user/app/app.py", line 292, in
run_update_dataset()
File "/home/user/app/app.py", line 270, in run_update_dataset
update_leaderboard_dataset(rl_env["rl_env"], path_)
File "/home/user/app/app.py", line 212, in update_leaderboard_dataset
mean_reward, std_reward = parse_rewards(accuracy)
File "/home/user/app/app.py", line 175, in parse_rewards
mean_reward = float(parsed[0])
ValueError: could not convert string to float: '1.0000+/-0.00'

Based on this, it seems this data misses the spaces that were expected around "+/-". I updated the logic so it can handle both "+/-" and " +/- ".
I don't know if this is an acceptable change, but I thought to create a PR for it anyway since the current leaderboard is broken.

Huggingface Projects org

Thanks for the update. I appreciate it ๐Ÿค— I'm merging it

ThomasSimonini changed pull request status to merged

Sign up or log in to comment