Commit
ยท
c563337
1
Parent(s):
e54d30a
Added flags to language checkboxes
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
import core as core
|
| 4 |
-
from style import CSS, T_SYMBOLS, TITLE
|
| 5 |
|
| 6 |
demo = gr.Blocks(css=CSS)
|
| 7 |
with demo:
|
|
@@ -38,7 +38,7 @@ with demo:
|
|
| 38 |
)
|
| 39 |
with gr.Row():
|
| 40 |
langs_bar = gr.CheckboxGroup(
|
| 41 |
-
choices=core.languages_list,
|
| 42 |
value=core.languages_list,
|
| 43 |
label="Select languages to average over",
|
| 44 |
elem_id="column-select",
|
|
@@ -58,7 +58,7 @@ with demo:
|
|
| 58 |
|
| 59 |
def update_bar():
|
| 60 |
langs_bar = gr.CheckboxGroup(
|
| 61 |
-
choices=core.languages_list,
|
| 62 |
value=core.languages_list,
|
| 63 |
label="Select languages to average over",
|
| 64 |
elem_id="column-select",
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
import core as core
|
| 4 |
+
from style import CSS, T_SYMBOLS, TITLE, LANG_SYMBOLS
|
| 5 |
|
| 6 |
demo = gr.Blocks(css=CSS)
|
| 7 |
with demo:
|
|
|
|
| 38 |
)
|
| 39 |
with gr.Row():
|
| 40 |
langs_bar = gr.CheckboxGroup(
|
| 41 |
+
choices=[(LANG_SYMBOLS.get(l,l),l) for l in core.languages_list],
|
| 42 |
value=core.languages_list,
|
| 43 |
label="Select languages to average over",
|
| 44 |
elem_id="column-select",
|
|
|
|
| 58 |
|
| 59 |
def update_bar():
|
| 60 |
langs_bar = gr.CheckboxGroup(
|
| 61 |
+
choices=[(LANG_SYMBOLS.get(l,l),l) for l in core.languages_list],
|
| 62 |
value=core.languages_list,
|
| 63 |
label="Select languages to average over",
|
| 64 |
elem_id="column-select",
|
style.py
CHANGED
|
@@ -10,7 +10,33 @@ CSS = """
|
|
| 10 |
display: none !important;
|
| 11 |
}
|
| 12 |
"""
|
|
|
|
| 13 |
T_SYMBOLS = {
|
| 14 |
"pretrained": "๐ข",
|
| 15 |
"chat": "๐ฌ"
|
| 16 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
display: none !important;
|
| 11 |
}
|
| 12 |
"""
|
| 13 |
+
|
| 14 |
T_SYMBOLS = {
|
| 15 |
"pretrained": "๐ข",
|
| 16 |
"chat": "๐ฌ"
|
| 17 |
}
|
| 18 |
+
|
| 19 |
+
LANG_SYMBOLS = {
|
| 20 |
+
"BG": "๐ง๐ฌ BG",
|
| 21 |
+
"CS": "๐จ๐ฟ CZ",
|
| 22 |
+
"DA": "๐ฉ๐ฐ DK",
|
| 23 |
+
"EL": "๐ฌ๐ท EL",
|
| 24 |
+
"ET": "๐ช๐ช ET",
|
| 25 |
+
"ES": "๐ช๐ธ ES",
|
| 26 |
+
"EN": "๐ฌ๐ง EN",
|
| 27 |
+
"FI": "๐ซ๐ฎ FI",
|
| 28 |
+
"DE": "๐ฉ๐ช DE",
|
| 29 |
+
"FR": "๐ซ๐ท FR",
|
| 30 |
+
"HU": "๐ญ๐บ HU",
|
| 31 |
+
"IT": "๐ฎ๐น IT",
|
| 32 |
+
"LT": "๐ฑ๐น LT",
|
| 33 |
+
"LV": "๐ฑ๐ป LV",
|
| 34 |
+
"NL": "๐ณ๐ฑ NL",
|
| 35 |
+
"PL": "๐ต๐ฑ PL",
|
| 36 |
+
"PT-PT": "๐ต๐น PT",
|
| 37 |
+
"RO": "๐ท๐ด RO",
|
| 38 |
+
"SK": "๐ธ๐ฐ SK",
|
| 39 |
+
"SL": "๐ธ๐ฎ SL",
|
| 40 |
+
"SV": "๐ธ๐ช SV"
|
| 41 |
+
}
|
| 42 |
+
|