hysts HF staff commited on
Commit
0d259e6
1 Parent(s): 690eaf0
Files changed (2) hide show
  1. app.py +18 -19
  2. src/i18n.py +11 -0
app.py CHANGED
@@ -37,6 +37,16 @@ from src.display.utils import (
37
  fields,
38
  )
39
  from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO
 
 
 
 
 
 
 
 
 
 
40
  from src.populate import get_evaluation_queue_df, get_leaderboard_df
41
  from src.submission.submit import add_new_eval
42
 
@@ -342,13 +352,6 @@ def plot_average_scores(df_filtered: pd.DataFrame) -> go.Figure:
342
  return fig
343
 
344
 
345
- SELECT_ALL_BUTTON_LABEL = "Select All"
346
- SELECT_ALL_BUTTON_LABEL_JA = "全選択"
347
- SELECT_NONE_BUTTON_LABEL = "Select None"
348
- SELECT_NONE_BUTTON_LABEL_JA = "全解除"
349
- SELECT_AVG_ONLY_BUTTON_LABEL = "AVG Only"
350
- SELECT_AVG_ONLY_BUTTON_LABEL_JA = "AVGのみ"
351
-
352
  shown_columns_dict: dict[str, gr.CheckboxGroup] = {}
353
  checkboxes: list[gr.CheckboxGroup] = []
354
 
@@ -638,10 +641,6 @@ with gr.Blocks() as demo_submission:
638
  # Main demo
639
 
640
 
641
- CITATION_ACCORDION_LABEL = "📙 Citation"
642
- CITATION_ACCORDION_LABEL_JA = "📙 引用"
643
-
644
-
645
  def set_default_language(request: gr.Request) -> gr.Radio:
646
  if request.headers["Accept-Language"].split(",")[0].lower().startswith("ja"):
647
  return gr.Radio(value="🇯🇵 JA")
@@ -652,14 +651,14 @@ def set_default_language(request: gr.Request) -> gr.Radio:
652
  def update_language(
653
  language: str,
654
  ) -> tuple[
655
- gr.Markdown,
656
- gr.Markdown,
657
- gr.Markdown,
658
- gr.Textbox,
659
- gr.Button,
660
- gr.Button,
661
- gr.Button,
662
- gr.Accordion,
663
  ]:
664
  if language == "🇯🇵 JA":
665
  return (
 
37
  fields,
38
  )
39
  from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO
40
+ from src.i18n import (
41
+ CITATION_ACCORDION_LABEL,
42
+ CITATION_ACCORDION_LABEL_JA,
43
+ SELECT_ALL_BUTTON_LABEL,
44
+ SELECT_ALL_BUTTON_LABEL_JA,
45
+ SELECT_AVG_ONLY_BUTTON_LABEL,
46
+ SELECT_AVG_ONLY_BUTTON_LABEL_JA,
47
+ SELECT_NONE_BUTTON_LABEL,
48
+ SELECT_NONE_BUTTON_LABEL_JA,
49
+ )
50
  from src.populate import get_evaluation_queue_df, get_leaderboard_df
51
  from src.submission.submit import add_new_eval
52
 
 
352
  return fig
353
 
354
 
 
 
 
 
 
 
 
355
  shown_columns_dict: dict[str, gr.CheckboxGroup] = {}
356
  checkboxes: list[gr.CheckboxGroup] = []
357
 
 
641
  # Main demo
642
 
643
 
 
 
 
 
644
  def set_default_language(request: gr.Request) -> gr.Radio:
645
  if request.headers["Accept-Language"].split(",")[0].lower().startswith("ja"):
646
  return gr.Radio(value="🇯🇵 JA")
 
651
  def update_language(
652
  language: str,
653
  ) -> tuple[
654
+ gr.Markdown, # introduction_text
655
+ gr.Markdown, # llm_benchmarks_text
656
+ gr.Markdown, # evaluation_queue_text
657
+ gr.Textbox, # citation_button
658
+ gr.Button, # select_all_button
659
+ gr.Button, # select_none_button
660
+ gr.Button, # select_avg_only_button
661
+ gr.Accordion, # citation_accordion
662
  ]:
663
  if language == "🇯🇵 JA":
664
  return (
src/i18n.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Column selection
2
+ SELECT_ALL_BUTTON_LABEL = "Select All"
3
+ SELECT_ALL_BUTTON_LABEL_JA = "全選択"
4
+ SELECT_NONE_BUTTON_LABEL = "Select None"
5
+ SELECT_NONE_BUTTON_LABEL_JA = "全解除"
6
+ SELECT_AVG_ONLY_BUTTON_LABEL = "AVG Only"
7
+ SELECT_AVG_ONLY_BUTTON_LABEL_JA = "AVGのみ"
8
+
9
+ # Citation
10
+ CITATION_ACCORDION_LABEL = "📙 Citation"
11
+ CITATION_ACCORDION_LABEL_JA = "📙 引用"