diff --git a/examples/flax/test_flax_examples.py b/examples/flax/test_flax_examples.py index ffb1a4fc249..2fc2dcc16ad 100644 --- a/examples/flax/test_flax_examples.py +++ b/examples/flax/test_flax_examples.py @@ -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)