bhys commited on
Commit
80cd428
·
verified ·
1 Parent(s): 21a6e55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -17,7 +17,7 @@ from content import format_error, format_warning, format_log, TITLE, INTRODUCTIO
17
  CITATION_BUTTON_TEXT, model_hyperlink
18
 
19
  TOKEN = os.environ.get("TOKEN", None)
20
- print(TOKEN)
21
 
22
  OWNER = "autogenCTF"
23
  DATA_DATASET = f"{OWNER}/CTFAIA"
@@ -80,10 +80,15 @@ def get_dataframe_from_results(eval_results, split):
80
  "comprehension"]]
81
 
82
  numeric_cols = [c for c in local_df.column_names if c in ["expertise", "reasoning", "comprehension"]]
83
- df[numeric_cols] = df[numeric_cols].round(decimals=2)
84
-
85
  percent_cols = [c for c in local_df.column_names if c in ["success_rate", "completion_level"]]
86
- df = df.style.format("{:.2%}", subset=percent_cols)
 
 
 
 
 
 
 
87
  return df
88
 
89
 
@@ -337,4 +342,4 @@ with demo:
337
  scheduler = BackgroundScheduler()
338
  scheduler.add_job(restart_space, "interval", seconds=3600)
339
  scheduler.start()
340
- demo.launch(debug=True)
 
17
  CITATION_BUTTON_TEXT, model_hyperlink
18
 
19
  TOKEN = os.environ.get("TOKEN", None)
20
+ # print(TOKEN)
21
 
22
  OWNER = "autogenCTF"
23
  DATA_DATASET = f"{OWNER}/CTFAIA"
 
80
  "comprehension"]]
81
 
82
  numeric_cols = [c for c in local_df.column_names if c in ["expertise", "reasoning", "comprehension"]]
 
 
83
  percent_cols = [c for c in local_df.column_names if c in ["success_rate", "completion_level"]]
84
+
85
+ df_style_format = {}
86
+ for label in numeric_cols:
87
+ df_style_format[label] = "{:.2f}"
88
+ for label in percent_cols:
89
+ df_style_format[label] = "{:.2%}"
90
+ df = df.style.format(df_style_format)
91
+
92
  return df
93
 
94
 
 
342
  scheduler = BackgroundScheduler()
343
  scheduler.add_job(restart_space, "interval", seconds=3600)
344
  scheduler.start()
345
+ demo.launch()