lewtun HF staff commited on
Commit
051b4a2
β€’
1 Parent(s): 7e29f2d

Add comment

Browse files
Files changed (1) hide show
  1. run_evaluation_jobs.py +6 -1
run_evaluation_jobs.py CHANGED
@@ -28,6 +28,7 @@ def main():
28
  # Filter IDs for appropriate AutoTrain env (staging vs prod)
29
  projects_df = projects_df.copy().query(f"autotrain_env == '{AUTOTRAIN_ENV}'")
30
  projects_to_approve = projects_df["project_id"].astype(int).tolist()
 
31
  print(f"πŸš€ Found {len(projects_to_approve)} evaluation projects to approve!")
32
 
33
  for project_id in projects_to_approve:
@@ -37,7 +38,7 @@ def main():
37
  path=f"/projects/{project_id}",
38
  token=HF_TOKEN,
39
  domain=AUTOTRAIN_BACKEND_API,
40
- ).json()
41
  print(project_info)
42
  # Only start evaluation for projects with completed data processing (status=3)
43
  if project_info["status"] == 3 and project_info["training_status"] == "not_started":
@@ -52,8 +53,12 @@ def main():
52
  except Exception as e:
53
  print(f"There was a problem obtaining the project info for project ID {project_id}")
54
  print(f"Error message: {e}")
 
55
  pass
56
 
 
 
 
57
 
58
  if __name__ == "__main__":
59
  typer.run(main)
 
28
  # Filter IDs for appropriate AutoTrain env (staging vs prod)
29
  projects_df = projects_df.copy().query(f"autotrain_env == '{AUTOTRAIN_ENV}'")
30
  projects_to_approve = projects_df["project_id"].astype(int).tolist()
31
+ failed_approvals = []
32
  print(f"πŸš€ Found {len(projects_to_approve)} evaluation projects to approve!")
33
 
34
  for project_id in projects_to_approve:
 
38
  path=f"/projects/{project_id}",
39
  token=HF_TOKEN,
40
  domain=AUTOTRAIN_BACKEND_API,
41
+ ).json()q
42
  print(project_info)
43
  # Only start evaluation for projects with completed data processing (status=3)
44
  if project_info["status"] == 3 and project_info["training_status"] == "not_started":
 
53
  except Exception as e:
54
  print(f"There was a problem obtaining the project info for project ID {project_id}")
55
  print(f"Error message: {e}")
56
+ failed_approvals.append(project_id)
57
  pass
58
 
59
+ if len(failed_approvals) > 0:
60
+ print(f"🚨 Failed to approve {len(failed_approvals)} projects: {failed_approvals}")
61
+
62
 
63
  if __name__ == "__main__":
64
  typer.run(main)