Spaces:
Sleeping
Sleeping
fix buttons
Browse files
app.py
CHANGED
@@ -61,21 +61,16 @@ def preproc_chinese(text):
|
|
61 |
clean = replace_nonprint(clean)
|
62 |
return unicodedata.normalize("NFKC", clean)
|
63 |
|
64 |
-
# Gradio interface
|
65 |
-
def switch_direction(src_lang, tgt_lang):
|
66 |
-
return tgt_lang, src_lang
|
67 |
|
68 |
with gr.Blocks() as demo:
|
69 |
gr.Markdown("# AMIS - Chinese Translation Tool")
|
70 |
-
src_lang = gr.Radio(choices=["
|
71 |
-
tgt_lang = gr.Radio(choices=["
|
72 |
input_text = gr.Textbox(label="Input Text", placeholder="Enter text here...")
|
73 |
output_text = gr.Textbox(label="Translated Text", interactive=False)
|
74 |
translate_btn = gr.Button("Translate")
|
75 |
-
switch_btn = gr.Button("Switch Direction")
|
76 |
-
|
77 |
translate_btn.click(translate, inputs=[input_text, src_lang, tgt_lang], outputs=output_text)
|
78 |
-
|
79 |
|
80 |
if __name__ == "__main__":
|
81 |
demo.launch()
|
|
|
61 |
clean = replace_nonprint(clean)
|
62 |
return unicodedata.normalize("NFKC", clean)
|
63 |
|
|
|
|
|
|
|
64 |
|
65 |
with gr.Blocks() as demo:
|
66 |
gr.Markdown("# AMIS - Chinese Translation Tool")
|
67 |
+
src_lang = gr.Radio(choices=["汉语 Chinese", "Amis"], value="zho_Hant", label="Source Language")
|
68 |
+
tgt_lang = gr.Radio(choices=["Amis", "汉语 Chinese"], value="ami_Latn", label="Target Language")
|
69 |
input_text = gr.Textbox(label="Input Text", placeholder="Enter text here...")
|
70 |
output_text = gr.Textbox(label="Translated Text", interactive=False)
|
71 |
translate_btn = gr.Button("Translate")
|
|
|
|
|
72 |
translate_btn.click(translate, inputs=[input_text, src_lang, tgt_lang], outputs=output_text)
|
73 |
+
gr.Markdown("感謝您在此專案上的辛勤工作 這只是這些模型能力的一小部分展示。電子郵件: [email protected]")
|
74 |
|
75 |
if __name__ == "__main__":
|
76 |
demo.launch()
|