Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,31 +104,28 @@ with gr.Blocks(title="Seed-X") as demo:
|
|
| 104 |
|
| 105 |
with gr.Row():
|
| 106 |
with gr.Column():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
source_text = gr.Textbox(
|
| 108 |
label="Input Text",
|
| 109 |
placeholder="Please enter the text to translate...",
|
| 110 |
lines=5
|
| 111 |
)
|
| 112 |
-
with gr.Row():
|
| 113 |
-
source_lang = gr.Dropdown(
|
| 114 |
-
choices=list(LANGUAGES.keys()),
|
| 115 |
-
value="Auto Detect",
|
| 116 |
-
label="Source Language"
|
| 117 |
-
)
|
| 118 |
-
target_lang = gr.Dropdown(
|
| 119 |
-
choices=list(LANGUAGES.keys())[1:], # Exclude "Auto Detect"
|
| 120 |
-
value="English",
|
| 121 |
-
label="Target Language"
|
| 122 |
-
)
|
| 123 |
-
|
| 124 |
-
translate_btn = gr.Button("Translate", variant="primary")
|
| 125 |
-
|
| 126 |
with gr.Column():
|
| 127 |
target_text = gr.Textbox(
|
| 128 |
label="Translation Result",
|
| 129 |
interactive=False,
|
| 130 |
lines=5
|
| 131 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
|
| 134 |
# # 示例
|
|
|
|
| 104 |
|
| 105 |
with gr.Row():
|
| 106 |
with gr.Column():
|
| 107 |
+
source_lang = gr.Dropdown(
|
| 108 |
+
choices=list(LANGUAGES.keys()),
|
| 109 |
+
value="Auto Detect",
|
| 110 |
+
label="Source Language"
|
| 111 |
+
)
|
| 112 |
source_text = gr.Textbox(
|
| 113 |
label="Input Text",
|
| 114 |
placeholder="Please enter the text to translate...",
|
| 115 |
lines=5
|
| 116 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
with gr.Column():
|
| 118 |
target_text = gr.Textbox(
|
| 119 |
label="Translation Result",
|
| 120 |
interactive=False,
|
| 121 |
lines=5
|
| 122 |
)
|
| 123 |
+
target_lang = gr.Dropdown(
|
| 124 |
+
choices=list(LANGUAGES.keys())[1:], # Exclude "Auto Detect"
|
| 125 |
+
value="English",
|
| 126 |
+
label="Target Language"
|
| 127 |
+
)
|
| 128 |
+
translate_btn = gr.Button("Translate", variant="primary")
|
| 129 |
|
| 130 |
|
| 131 |
# # 示例
|