Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Add Japanese translation
Browse files- app.py +11 -3
- src/about.py +3 -0
app.py
CHANGED
@@ -8,6 +8,7 @@ from huggingface_hub import snapshot_download
|
|
8 |
from src.about import (
|
9 |
BOTTOM_LOGO,
|
10 |
CITATION_BUTTON_LABEL,
|
|
|
11 |
CITATION_BUTTON_TEXT,
|
12 |
EVALUATION_QUEUE_TEXT,
|
13 |
EVALUATION_QUEUE_TEXT_JP,
|
@@ -522,18 +523,20 @@ def set_default_language(request: gr.Request) -> gr.Dropdown:
|
|
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 |
|
@@ -554,7 +557,7 @@ with gr.Blocks(css=custom_css, css_paths="style.css", theme=gr.themes.Glass()) a
|
|
554 |
with gr.Row():
|
555 |
with gr.Accordion("📙 Citation", open=False):
|
556 |
citation_button = gr.Textbox(
|
557 |
-
label=
|
558 |
value=CITATION_BUTTON_TEXT,
|
559 |
lines=20,
|
560 |
elem_id="citation-button",
|
@@ -574,7 +577,12 @@ with gr.Blocks(css=custom_css, css_paths="style.css", theme=gr.themes.Glass()) a
|
|
574 |
language.change(
|
575 |
fn=update_language,
|
576 |
inputs=language,
|
577 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
|
578 |
api_name=False,
|
579 |
)
|
580 |
|
|
|
8 |
from src.about import (
|
9 |
BOTTOM_LOGO,
|
10 |
CITATION_BUTTON_LABEL,
|
11 |
+
CITATION_BUTTON_LABEL_JP,
|
12 |
CITATION_BUTTON_TEXT,
|
13 |
EVALUATION_QUEUE_TEXT,
|
14 |
EVALUATION_QUEUE_TEXT_JP,
|
|
|
523 |
return gr.Dropdown(value="🇺🇸 EN")
|
524 |
|
525 |
|
526 |
+
def update_language(language: str) -> tuple[gr.Markdown, gr.Markdown, gr.Markdown, gr.Textbox]:
|
527 |
if language == "🇯🇵 JP":
|
528 |
return (
|
529 |
gr.Markdown(value=INTRODUCTION_TEXT_JP),
|
530 |
gr.Markdown(value=LLM_BENCHMARKS_TEXT_JP),
|
531 |
gr.Markdown(value=EVALUATION_QUEUE_TEXT_JP),
|
532 |
+
gr.Textbox(label=CITATION_BUTTON_LABEL_JP),
|
533 |
)
|
534 |
else:
|
535 |
return (
|
536 |
gr.Markdown(value=INTRODUCTION_TEXT),
|
537 |
gr.Markdown(value=LLM_BENCHMARKS_TEXT),
|
538 |
gr.Markdown(value=EVALUATION_QUEUE_TEXT),
|
539 |
+
gr.Textbox(label=CITATION_BUTTON_LABEL),
|
540 |
)
|
541 |
|
542 |
|
|
|
557 |
with gr.Row():
|
558 |
with gr.Accordion("📙 Citation", open=False):
|
559 |
citation_button = gr.Textbox(
|
560 |
+
label=CITATION_BUTTON_LABEL_JP,
|
561 |
value=CITATION_BUTTON_TEXT,
|
562 |
lines=20,
|
563 |
elem_id="citation-button",
|
|
|
577 |
language.change(
|
578 |
fn=update_language,
|
579 |
inputs=language,
|
580 |
+
outputs=[
|
581 |
+
introduction_text,
|
582 |
+
llm_benchmarks_text,
|
583 |
+
evaluation_queue_text,
|
584 |
+
citation_button,
|
585 |
+
],
|
586 |
api_name=False,
|
587 |
)
|
588 |
|
src/about.py
CHANGED
@@ -376,7 +376,10 @@ BOTTOM_LOGO = """
|
|
376 |
</a>
|
377 |
</div>
|
378 |
"""
|
|
|
379 |
CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"
|
|
|
|
|
380 |
CITATION_BUTTON_TEXT = r"""@misc{OJLL,
|
381 |
author = {Miyao, Yusuke and Ishida, Shigeki and Okamoto, Takumi and Han, Namgi and Mousterou, Akim and Fourrier, Clémentine and Hayashi, Toshihiro and Tachibana, Yuichiro},
|
382 |
title = {Open Japanese LLM Leaderboard},
|
|
|
376 |
</a>
|
377 |
</div>
|
378 |
"""
|
379 |
+
|
380 |
CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"
|
381 |
+
CITATION_BUTTON_LABEL_JP = "引用の際は、次のスニペットをコピーしてご利用ください"
|
382 |
+
|
383 |
CITATION_BUTTON_TEXT = r"""@misc{OJLL,
|
384 |
author = {Miyao, Yusuke and Ishida, Shigeki and Okamoto, Takumi and Han, Namgi and Mousterou, Akim and Fourrier, Clémentine and Hayashi, Toshihiro and Tachibana, Yuichiro},
|
385 |
title = {Open Japanese LLM Leaderboard},
|