Spaces:
Running
Running
admin
commited on
Commit
·
48cb7fe
1
Parent(s):
c9e71be
2 en
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import gradio as gr
|
|
6 |
|
7 |
def translate(source, direction):
|
8 |
if not source or not direction:
|
9 |
-
return "
|
10 |
|
11 |
# WARNING, this token is a test token for new developers, and it should be replaced by your token
|
12 |
payload = {
|
@@ -38,16 +38,16 @@ if __name__ == "__main__":
|
|
38 |
fn=translate,
|
39 |
inputs=[
|
40 |
gr.TextArea(
|
41 |
-
label="
|
42 |
-
placeholder="
|
43 |
show_copy_button=True,
|
44 |
),
|
45 |
-
gr.Dropdown(choices=["auto2en", "auto2zh", "auto2ja"], label="
|
46 |
],
|
47 |
-
outputs=gr.TextArea(label="
|
48 |
flagging_mode="never",
|
49 |
examples=[
|
50 |
-
["彩云小译は最高の翻訳サービスです", "
|
51 |
["Lingocloud is the best translation service.", "auto2zh"],
|
52 |
],
|
53 |
).launch()
|
|
|
6 |
|
7 |
def translate(source, direction):
|
8 |
if not source or not direction:
|
9 |
+
return "Please enter valid text and select the mode!"
|
10 |
|
11 |
# WARNING, this token is a test token for new developers, and it should be replaced by your token
|
12 |
payload = {
|
|
|
38 |
fn=translate,
|
39 |
inputs=[
|
40 |
gr.TextArea(
|
41 |
+
label="Input text area",
|
42 |
+
placeholder="Type the text here...",
|
43 |
show_copy_button=True,
|
44 |
),
|
45 |
+
gr.Dropdown(choices=["auto2en", "auto2zh", "auto2ja"], label="Mode"),
|
46 |
],
|
47 |
+
outputs=gr.TextArea(label="Translation results", show_copy_button=True),
|
48 |
flagging_mode="never",
|
49 |
examples=[
|
50 |
+
["彩云小译は最高の翻訳サービスです", "auto2en"],
|
51 |
["Lingocloud is the best translation service.", "auto2zh"],
|
52 |
],
|
53 |
).launch()
|