ZeroCommand commited on
Commit
64f50dd
1 Parent(s): b0a573f

fix run job logs

Browse files
Files changed (2) hide show
  1. app_leaderboard.py +3 -4
  2. io_utils.py +5 -3
app_leaderboard.py CHANGED
@@ -32,7 +32,7 @@ def get_dataset_ids(ds):
32
  return dataset_ids
33
 
34
  def get_types(ds):
35
- # set all types for each column
36
  types = [str(t) for t in ds.dtypes.to_list()]
37
  types = [t.replace('object', 'markdown') for t in types]
38
  types = [t.replace('float64', 'number') for t in types]
@@ -61,10 +61,9 @@ def get_demo():
61
 
62
  column_names = records.columns.tolist()
63
  default_columns = ['model_id', 'dataset_id', 'total_issues', 'report_link']
64
- # set the default columns to show
65
- default_df = records[default_columns]
66
  types = get_types(default_df)
67
- display_df = get_display_df(default_df)
68
 
69
  with gr.Row():
70
  task_select = gr.Dropdown(label='Task', choices=['text_classification', 'tabular'], value='text_classification', interactive=True)
 
32
  return dataset_ids
33
 
34
  def get_types(ds):
35
+ # set types for each column
36
  types = [str(t) for t in ds.dtypes.to_list()]
37
  types = [t.replace('object', 'markdown') for t in types]
38
  types = [t.replace('float64', 'number') for t in types]
 
61
 
62
  column_names = records.columns.tolist()
63
  default_columns = ['model_id', 'dataset_id', 'total_issues', 'report_link']
64
+ default_df = records[default_columns] # extract columns selected
 
65
  types = get_types(default_df)
66
+ display_df = get_display_df(default_df) # the styled dataframe to display
67
 
68
  with gr.Row():
69
  task_select = gr.Dropdown(label='Task', choices=['text_classification', 'tabular'], value='text_classification', interactive=True)
io_utils.py CHANGED
@@ -108,10 +108,12 @@ def pop_job_from_pipe():
108
  job_info = job.split('\n')[0].split("@")
109
  if len(job_info) != 2:
110
  raise ValueError("Invalid job info: ", job_info)
111
- print(f"Running job {job_info}")
 
112
  command = job_info[1].split(",")
113
- print(command)
114
- log_file = open(f"./tmp/{job_info[0]}_log", "w")
 
115
  subprocess.Popen(
116
  command,
117
  cwd=os.path.join(os.path.dirname(os.path.realpath(__file__)), "cicd"),
 
108
  job_info = job.split('\n')[0].split("@")
109
  if len(job_info) != 2:
110
  raise ValueError("Invalid job info: ", job_info)
111
+
112
+ write_log_to_user_file(job_info[0], f"Running job {job_info}")
113
  command = job_info[1].split(",")
114
+
115
+ write_log_to_user_file(job_info[0], f"Running command {command}")
116
+ log_file = open(f"./tmp/{job_info[0]}_log", "a")
117
  subprocess.Popen(
118
  command,
119
  cwd=os.path.join(os.path.dirname(os.path.realpath(__file__)), "cicd"),