Fix different results filenames locally and in the Hub

#19
by albertvillanova HF staff - opened
Demo leaderboard with an integrated backend org
edited 9 days ago

Fix different results filenames locally and in the Hub.

Currently, the results filenames written locally and pushed to the Hub are different because detetime.now is called twice:

output_path = os.path.join(local_dir, *eval_request.model.split("/"), f"results_{datetime.now()}.json")
with open(output_path, "w") as f:
...
API.upload_file(
    path_in_repo=f"{eval_request.model}/results_{datetime.now()}.json",

This PR fixes the issue by calling detetime.now only once and reusing the filename for both writing locally and pushing to the Hub.

albertvillanova changed pull request status to open
clefourrier changed pull request status to merged

Sign up or log in to comment