eyalol commited on
Commit
ff4e61f
1 Parent(s): e27cdeb

Update src/display/utils.py

Browse files
Files changed (1) hide show
  1. src/display/utils.py +12 -2
src/display/utils.py CHANGED
@@ -9,6 +9,10 @@ def fields(raw_class):
9
  return [v for k, v in raw_class.__dict__.items() if k[:2] != "__" and k[-2:] != "__"]
10
 
11
 
 
 
 
 
12
  # These classes are for user facing column names,
13
  # to avoid having to change them all around the code
14
  # when a modif is needed
@@ -40,8 +44,14 @@ auto_eval_column_dict.append(["likes", ColumnContent, ColumnContent("Hub ❤️"
40
  auto_eval_column_dict.append(["still_on_hub", ColumnContent, ColumnContent("Available on the hub", "bool", False)])
41
  auto_eval_column_dict.append(["revision", ColumnContent, ColumnContent("Model sha", "str", False, False)])
42
 
43
- # We use make dataclass to dynamically fill the scores from Tasks
44
- AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)
 
 
 
 
 
 
45
 
46
  ## For the queue columns in the submission tab
47
  @dataclass(frozen=True)
 
9
  return [v for k, v in raw_class.__dict__.items() if k[:2] != "__" and k[-2:] != "__"]
10
 
11
 
12
+ def make_clickable_model(model_name: str) -> str:
13
+ link = f"https://huggingface.co/ivrit-ai/{model_name}"
14
+ return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
15
+
16
  # These classes are for user facing column names,
17
  # to avoid having to change them all around the code
18
  # when a modif is needed
 
44
  auto_eval_column_dict.append(["still_on_hub", ColumnContent, ColumnContent("Available on the hub", "bool", False)])
45
  auto_eval_column_dict.append(["revision", ColumnContent, ColumnContent("Model sha", "str", False, False)])
46
 
47
+ @dataclass(frozen=True)
48
+ class AutoEvalColumn: # Auto evals column
49
+ model = ColumnContent("Model", "markdown", False)
50
+ avg_wer = ColumnContent("Average WER ⬇️", "number", False)
51
+
52
+ # TODO: The following is an example of WER for datasets, we'd want to replace those with actual relevant dataset names
53
+ dataset1_wer = ColumnContent("Dataset1", "number", False)
54
+ dataset2_wer = ColumnContent("Dataset2", "number", False)
55
 
56
  ## For the queue columns in the submission tab
57
  @dataclass(frozen=True)