Unverified Commit 3b309818 authored by milyiyo's avatar milyiyo Committed by GitHub
Browse files

Refactor the function get_results (#20999)

parent 92645229
......@@ -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:
return json.load(f)
raise ValueError(f"can't find {path}")
return results
stream_handler = logging.StreamHandler(sys.stdout)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment