rafaelpadilla commited on
Commit
906a076
1 Parent(s): 198a494

checking model already evaluated

Browse files
Files changed (2) hide show
  1. app.py +9 -3
  2. utils_display.py +3 -3
app.py CHANGED
@@ -33,6 +33,8 @@ if not csv_results.exists():
33
 
34
  # Get csv with data and parse columns
35
  original_df = pd.read_csv(csv_results)
 
 
36
 
37
  # Formats the columns
38
  def decimal_formatter(x):
@@ -64,7 +66,6 @@ original_df.rename(columns=column_names, inplace=True)
64
  COLS = [c.name for c in fields(AutoEvalColumn)]
65
  TYPES = [c.type for c in fields(AutoEvalColumn)]
66
 
67
-
68
  def request_model(model_text, chbcoco2017):
69
 
70
  # Determine the selected checkboxes
@@ -74,12 +75,17 @@ def request_model(model_text, chbcoco2017):
74
 
75
  if len(dataset_selection) == 0:
76
  return styled_error("You need to select at least one dataset")
77
-
 
78
  base_model_on_hub, error_msg = is_model_on_hub(model_text)
79
-
80
  if not base_model_on_hub:
81
  return styled_error(f"Base model '{model_text}' {error_msg}")
82
 
 
 
 
 
 
83
  # Construct the output dictionary
84
  current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
85
  required_datasets = ', '.join(dataset_selection)
 
33
 
34
  # Get csv with data and parse columns
35
  original_df = pd.read_csv(csv_results)
36
+ lst_evaluated_models = original_df["model"].tolist()
37
+ lst_evaluated_models = list(map(str.lower, lst_evaluated_models))
38
 
39
  # Formats the columns
40
  def decimal_formatter(x):
 
66
  COLS = [c.name for c in fields(AutoEvalColumn)]
67
  TYPES = [c.type for c in fields(AutoEvalColumn)]
68
 
 
69
  def request_model(model_text, chbcoco2017):
70
 
71
  # Determine the selected checkboxes
 
75
 
76
  if len(dataset_selection) == 0:
77
  return styled_error("You need to select at least one dataset")
78
+
79
+ # Check if model exists on the hub
80
  base_model_on_hub, error_msg = is_model_on_hub(model_text)
 
81
  if not base_model_on_hub:
82
  return styled_error(f"Base model '{model_text}' {error_msg}")
83
 
84
+ # Check if model is already evaluated
85
+ model_text = model_text.replace(" ","")
86
+ if model_text.lower() in lst_evaluated_models:
87
+ return styled_error(f"Results of the model '{model_text}' are now ready and available.")
88
+
89
  # Construct the output dictionary
90
  current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
91
  required_datasets = ', '.join(dataset_selection)
utils_display.py CHANGED
@@ -15,7 +15,7 @@ class AutoEvalColumn: # Auto evals column
15
  model = ColumnContent("Model", "markdown")
16
  ap = ColumnContent("AP", "str")
17
  ap50 = ColumnContent("AP@.50", "number")
18
- ap75 = ColumnContent("AP@.75 ⬆️", "number")
19
  ap_small = ColumnContent("AP-S", "number")
20
  ap_medium = ColumnContent("AP-M", "number")
21
  ap_large = ColumnContent("AP-L", "number")
@@ -25,8 +25,8 @@ class AutoEvalColumn: # Auto evals column
25
  ar_small = ColumnContent("AR-S", "number")
26
  ar_medium = ColumnContent("AR-M", "number")
27
  ar_large = ColumnContent("AR-L", "number")
28
- ar_large = ColumnContent("FPS(*)", "number")
29
- ar_large = ColumnContent("hub license", "str")
30
 
31
  def make_clickable_model(model_name):
32
  link = f"https://huggingface.co/{model_name}"
 
15
  model = ColumnContent("Model", "markdown")
16
  ap = ColumnContent("AP", "str")
17
  ap50 = ColumnContent("AP@.50", "number")
18
+ ap75 = ColumnContent("AP@.75", "number")
19
  ap_small = ColumnContent("AP-S", "number")
20
  ap_medium = ColumnContent("AP-M", "number")
21
  ap_large = ColumnContent("AP-L", "number")
 
25
  ar_small = ColumnContent("AR-S", "number")
26
  ar_medium = ColumnContent("AR-M", "number")
27
  ar_large = ColumnContent("AR-L", "number")
28
+ fps = ColumnContent("FPS(*)", "number")
29
+ license = ColumnContent("hub license", "str")
30
 
31
  def make_clickable_model(model_name):
32
  link = f"https://huggingface.co/{model_name}"