Spaces:
Runtime error
Runtime error
Update failed_run.py
Browse files- failed_run.py +3 -7
failed_run.py
CHANGED
@@ -27,7 +27,7 @@ parser.add_argument(
|
|
27 |
args = parser.parse_args()
|
28 |
|
29 |
# Updating request
|
30 |
-
|
31 |
|
32 |
def upload_results():
|
33 |
models_ran=[]
|
@@ -37,13 +37,8 @@ def upload_results():
|
|
37 |
if s.is_dir() and s.name not in ['hooks','info','objects','refs','logs']:
|
38 |
for m in os.scandir(s):
|
39 |
models_ran.append(s.name+'/' + m.name)
|
40 |
-
|
41 |
-
print("Models ran are: " + str(models_ran))
|
42 |
|
43 |
-
requests_dset.loc[requests_dset["model"].isin(models_ran), ['status']] = "COMPLETED"
|
44 |
-
updated_dset =Dataset.from_pandas(requests_dset)
|
45 |
-
updated_dset.push_to_hub("EnergyStarAI/requests_debug", split="test", token=TOKEN)
|
46 |
-
print("Updated model status")
|
47 |
|
48 |
# Set benchmark to failed
|
49 |
# TODO: This doesn't have to be try-except, we could actually check if the file is there.
|
@@ -58,6 +53,7 @@ try:
|
|
58 |
else:
|
59 |
dataset.loc[dataset["model"].isin([args.model_name]), ['status']] = "COMPLETED"
|
60 |
upload_results()
|
|
|
61 |
print("Status set to COMPLETE")
|
62 |
# Add a new column for the error message if necessary
|
63 |
if "error_message" not in dataset.columns:
|
|
|
27 |
args = parser.parse_args()
|
28 |
|
29 |
# Updating request
|
30 |
+
dataset = load_dataset("EnergyStarAI/requests_debug", split="test", token=TOKEN).to_pandas()
|
31 |
|
32 |
def upload_results():
|
33 |
models_ran=[]
|
|
|
37 |
if s.is_dir() and s.name not in ['hooks','info','objects','refs','logs']:
|
38 |
for m in os.scandir(s):
|
39 |
models_ran.append(s.name+'/' + m.name)
|
40 |
+
return models_ran
|
|
|
41 |
|
|
|
|
|
|
|
|
|
42 |
|
43 |
# Set benchmark to failed
|
44 |
# TODO: This doesn't have to be try-except, we could actually check if the file is there.
|
|
|
53 |
else:
|
54 |
dataset.loc[dataset["model"].isin([args.model_name]), ['status']] = "COMPLETED"
|
55 |
upload_results()
|
56 |
+
dataset.loc[dataset["model"].isin(models_ran), ['status']] = "COMPLETED"
|
57 |
print("Status set to COMPLETE")
|
58 |
# Add a new column for the error message if necessary
|
59 |
if "error_message" not in dataset.columns:
|