hysts HF staff commited on
Commit
b281f5a
β€’
1 Parent(s): 27f9d9d

Update the About tab to show Japanese translation

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -14,6 +14,7 @@ from src.about import (
14
  INTRODUCTION_TEXT,
15
  INTRODUCTION_TEXT_JP,
16
  LLM_BENCHMARKS_TEXT,
 
17
  TITLE,
18
  TaskType,
19
  )
@@ -521,11 +522,19 @@ def set_default_language(request: gr.Request) -> gr.Dropdown:
521
  return gr.Dropdown(value="πŸ‡ΊπŸ‡Έ EN")
522
 
523
 
524
- def update_language(language: str) -> tuple[gr.Markdown, gr.Markdown]:
525
  if language == "πŸ‡―πŸ‡΅ JP":
526
- return gr.Markdown(value=INTRODUCTION_TEXT_JP), gr.Markdown(value=EVALUATION_QUEUE_TEXT_JP)
 
 
 
 
527
  else:
528
- return gr.Markdown(value=INTRODUCTION_TEXT), gr.Markdown(value=EVALUATION_QUEUE_TEXT)
 
 
 
 
529
 
530
 
531
  with gr.Blocks(css=custom_css, css_paths="style.css", theme=gr.themes.Glass()) as demo:
@@ -537,7 +546,7 @@ with gr.Blocks(css=custom_css, css_paths="style.css", theme=gr.themes.Glass()) a
537
  demo_leaderboard.render()
538
 
539
  with gr.TabItem("πŸ“ About", elem_id="llm-benchmark-tab-table", id=2):
540
- gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
541
 
542
  with gr.TabItem("πŸš€ Submit here! ", elem_id="llm-benchmark-tab-table", id=3):
543
  demo_submission.render()
@@ -565,7 +574,7 @@ with gr.Blocks(css=custom_css, css_paths="style.css", theme=gr.themes.Glass()) a
565
  language.change(
566
  fn=update_language,
567
  inputs=language,
568
- outputs=[introduction_text, evaluation_queue_text],
569
  api_name=False,
570
  )
571
 
 
14
  INTRODUCTION_TEXT,
15
  INTRODUCTION_TEXT_JP,
16
  LLM_BENCHMARKS_TEXT,
17
+ LLM_BENCHMARKS_TEXT_JP,
18
  TITLE,
19
  TaskType,
20
  )
 
522
  return gr.Dropdown(value="πŸ‡ΊπŸ‡Έ EN")
523
 
524
 
525
+ def update_language(language: str) -> tuple[gr.Markdown, gr.Markdown, gr.Markdown]:
526
  if language == "πŸ‡―πŸ‡΅ JP":
527
+ return (
528
+ gr.Markdown(value=INTRODUCTION_TEXT_JP),
529
+ gr.Markdown(value=LLM_BENCHMARKS_TEXT_JP),
530
+ gr.Markdown(value=EVALUATION_QUEUE_TEXT_JP),
531
+ )
532
  else:
533
+ return (
534
+ gr.Markdown(value=INTRODUCTION_TEXT),
535
+ gr.Markdown(value=LLM_BENCHMARKS_TEXT),
536
+ gr.Markdown(value=EVALUATION_QUEUE_TEXT),
537
+ )
538
 
539
 
540
  with gr.Blocks(css=custom_css, css_paths="style.css", theme=gr.themes.Glass()) as demo:
 
546
  demo_leaderboard.render()
547
 
548
  with gr.TabItem("πŸ“ About", elem_id="llm-benchmark-tab-table", id=2):
549
+ llm_benchmarks_text = gr.Markdown(LLM_BENCHMARKS_TEXT_JP, elem_classes="markdown-text")
550
 
551
  with gr.TabItem("πŸš€ Submit here! ", elem_id="llm-benchmark-tab-table", id=3):
552
  demo_submission.render()
 
574
  language.change(
575
  fn=update_language,
576
  inputs=language,
577
+ outputs=[introduction_text, llm_benchmarks_text, evaluation_queue_text],
578
  api_name=False,
579
  )
580