Spaces:
Runtime error
Runtime error
Update failed_run.py
Browse files- failed_run.py +8 -4
failed_run.py
CHANGED
@@ -30,13 +30,18 @@ args = parser.parse_args()
|
|
30 |
dataset = load_dataset("EnergyStarAI/requests_debug", split="test", token=TOKEN).to_pandas()
|
31 |
|
32 |
# Set benchmark to failed
|
33 |
-
dataset.loc[dataset["model"].isin([args.model_name]), ['status']] = "FAILED"
|
34 |
-
|
35 |
# TODO: This doesn't have to be try-except, we could actually check if the file is there.
|
36 |
try:
|
37 |
# Read error message
|
38 |
with open(f"{args.run_dir}/error.log", 'r') as file:
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
# Add a new column for the error message if necessary
|
41 |
if "error_message" not in dataset.columns:
|
42 |
dataset["error_message"] = ""
|
@@ -46,4 +51,3 @@ except FileNotFoundError as e:
|
|
46 |
|
47 |
updated_dataset = Dataset.from_pandas(dataset)
|
48 |
updated_dataset.push_to_hub("EnergyStarAI/requests_debug", split="test", token=TOKEN)
|
49 |
-
print("Status set to FAILED")
|
|
|
30 |
dataset = load_dataset("EnergyStarAI/requests_debug", split="test", token=TOKEN).to_pandas()
|
31 |
|
32 |
# Set benchmark to failed
|
|
|
|
|
33 |
# TODO: This doesn't have to be try-except, we could actually check if the file is there.
|
34 |
try:
|
35 |
# Read error message
|
36 |
with open(f"{args.run_dir}/error.log", 'r') as file:
|
37 |
+
for f in file.readlines():
|
38 |
+
if 'RuntimeError' in f:
|
39 |
+
error_message = f
|
40 |
+
dataset.loc[dataset["model"].isin([args.model_name]), ['status']] = "FAILED"
|
41 |
+
print("Status set to FAILED")
|
42 |
+
else:
|
43 |
+
dataset.loc[dataset["model"].isin([args.model_name]), ['status']] = "COMPLETED"
|
44 |
+
print("Status set to COMPLETE")
|
45 |
# Add a new column for the error message if necessary
|
46 |
if "error_message" not in dataset.columns:
|
47 |
dataset["error_message"] = ""
|
|
|
51 |
|
52 |
updated_dataset = Dataset.from_pandas(dataset)
|
53 |
updated_dataset.push_to_hub("EnergyStarAI/requests_debug", split="test", token=TOKEN)
|
|