Update utils_display.py
Browse files- utils_display.py +6 -18
utils_display.py
CHANGED
@@ -1,29 +1,20 @@
|
|
1 |
from dataclasses import dataclass
|
2 |
|
3 |
-
# These classes are for user
|
4 |
-
# all around the code when a
|
5 |
@dataclass
|
6 |
class ColumnContent:
|
7 |
name: str
|
8 |
-
type: str
|
9 |
|
10 |
def fields(raw_class):
|
11 |
return [v for k, v in raw_class.__dict__.items() if k[:2] != "__" and k[-2:] != "__"]
|
12 |
|
13 |
@dataclass(frozen=True)
|
14 |
-
class AutoEvalColumn:
|
15 |
model = ColumnContent("Model", "markdown")
|
16 |
-
|
17 |
-
|
18 |
-
ami_wer = ColumnContent("AMI", "number")
|
19 |
-
e22_wer = ColumnContent("Earnings22", "number")
|
20 |
-
gs_wer = ColumnContent("Gigaspeech", "number")
|
21 |
-
lsc_wer = ColumnContent("LS Clean", "number")
|
22 |
-
lso_wer = ColumnContent("LS Other", "number")
|
23 |
-
ss_wer = ColumnContent("SPGISpeech", "number")
|
24 |
-
tl_wer = ColumnContent("Tedlium", "number")
|
25 |
-
vp_wer = ColumnContent("Voxpopuli", "number")
|
26 |
-
|
27 |
|
28 |
def make_clickable_model(model_name):
|
29 |
link = f"https://huggingface.co/{model_name}"
|
@@ -32,8 +23,5 @@ def make_clickable_model(model_name):
|
|
32 |
def styled_error(error):
|
33 |
return f"<p style='color: red; font-size: 20px; text-align: center;'>{error}</p>"
|
34 |
|
35 |
-
def styled_warning(warn):
|
36 |
-
return f"<p style='color: orange; font-size: 20px; text-align: center;'>{warn}</p>"
|
37 |
-
|
38 |
def styled_message(message):
|
39 |
return f"<p style='color: green; font-size: 20px; text-align: center;'>{message}</p>"
|
|
|
1 |
from dataclasses import dataclass
|
2 |
|
3 |
+
# These classes are for user-facing column names, to avoid having to change them
|
4 |
+
# all around the code when a modification is needed
|
5 |
@dataclass
|
6 |
class ColumnContent:
|
7 |
name: str
|
8 |
+
type: str
|
9 |
|
10 |
def fields(raw_class):
|
11 |
return [v for k, v in raw_class.__dict__.items() if k[:2] != "__" and k[-2:] != "__"]
|
12 |
|
13 |
@dataclass(frozen=True)
|
14 |
+
class AutoEvalColumn: # Auto evals column
|
15 |
model = ColumnContent("Model", "markdown")
|
16 |
+
wer = ColumnContent("WER ⬇️", "number")
|
17 |
+
cer = ColumnContent("CER ⬇️", "number")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
def make_clickable_model(model_name):
|
20 |
link = f"https://huggingface.co/{model_name}"
|
|
|
23 |
def styled_error(error):
|
24 |
return f"<p style='color: red; font-size: 20px; text-align: center;'>{error}</p>"
|
25 |
|
|
|
|
|
|
|
26 |
def styled_message(message):
|
27 |
return f"<p style='color: green; font-size: 20px; text-align: center;'>{message}</p>"
|