mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-03 21:00:08 +06:00
Refactor the function get_results (#20999)
This commit is contained in:
parent
926452298d
commit
3b309818e7
@ -60,14 +60,11 @@ def get_setup_file():
|
||||
|
||||
|
||||
def get_results(output_dir, split="eval"):
|
||||
results = {}
|
||||
path = os.path.join(output_dir, f"{split}_results.json")
|
||||
if os.path.exists(path):
|
||||
with open(path, "r") as f:
|
||||
results = json.load(f)
|
||||
else:
|
||||
raise ValueError(f"can't find {path}")
|
||||
return results
|
||||
return json.load(f)
|
||||
raise ValueError(f"can't find {path}")
|
||||
|
||||
|
||||
stream_handler = logging.StreamHandler(sys.stdout)
|
||||
|
Loading…
Reference in New Issue
Block a user