meg HF staff commited on
Commit
052d8b5
·
verified ·
1 Parent(s): ee78e78

Update process_runs.py

Browse files
Files changed (1) hide show
  1. process_runs.py +12 -9
process_runs.py CHANGED
@@ -75,18 +75,21 @@ def update_requests(requests, all_attempts, failed_attempts):
75
  # Each line is a run directory, where
76
  # run_dir="/runs/${experiment_name}/${backend_model}/${now}"
77
  for line in all_attempts:
 
78
  split_run_dir = line.strip().split("/")
79
  task = split_run_dir[1]
80
  model = split_run_dir[2]
81
- if line not in failed_attempts:
82
- traceback_error = check_for_traceback(line)
83
- if traceback_error != "":
84
- print("Found a traceback error!")
85
- print(traceback_error)
86
- requests_df.loc[(requests_df["status"] == PENDING) & (requests_df["model"] == model) & (requests_df["task"] == task), ['status']] = FAILED
87
- requests_df.loc[(requests_df["status"] == PENDING) & (requests_df["model"] == model) & (requests_df["task"] == task), ['error_message']] = traceback_error
88
- else:
89
- requests_df.loc[(requests_df["status"] == PENDING) & (requests_df["model"] == model) & (requests_df["task"] == task), ['status']] = COMPLETED
 
 
90
  updated_dset = Dataset.from_pandas(requests_df)
91
  return updated_dset
92
 
 
75
  # Each line is a run directory, where
76
  # run_dir="/runs/${experiment_name}/${backend_model}/${now}"
77
  for line in all_attempts:
78
+ print(f"Checking {line}")
79
  split_run_dir = line.strip().split("/")
80
  task = split_run_dir[1]
81
  model = split_run_dir[2]
82
+ traceback_error = check_for_traceback(line)
83
+ if traceback_error != "":
84
+ print("Found a traceback error!")
85
+ print(traceback_error)
86
+ requests_df.loc[(requests_df["status"] == PENDING) & (requests_df["model"] == model) & (requests_df["task"] == task), ['status']] = FAILED
87
+ requests_df.loc[(requests_df["status"] == PENDING) & (requests_df["model"] == model) & (requests_df["task"] == task), ['error_message']] = traceback_error
88
+ elif line in failed_attempts:
89
+ print(f"Job failed, but not sure why -- didn't find a traceback in {line}")
90
+ requests_df.loc[(requests_df["status"] == PENDING) & (requests_df["model"] == model) & (requests_df["task"] == task), ['status']] = FAILED
91
+ else:
92
+ requests_df.loc[(requests_df["status"] == PENDING) & (requests_df["model"] == model) & (requests_df["task"] == task), ['status']] = COMPLETED
93
  updated_dset = Dataset.from_pandas(requests_df)
94
  return updated_dset
95