Spaces:
Runtime error
Runtime error
Update UI
Browse files
app.py
CHANGED
|
@@ -124,21 +124,25 @@ def run_asr(input_audio: str, target_language: str) -> str:
|
|
| 124 |
|
| 125 |
|
| 126 |
with gr.Blocks() as demo_s2st:
|
| 127 |
-
with gr.
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
gr.Examples(
|
| 144 |
examples=[
|
|
@@ -162,15 +166,18 @@ with gr.Blocks() as demo_s2st:
|
|
| 162 |
)
|
| 163 |
|
| 164 |
with gr.Blocks() as demo_s2tt:
|
| 165 |
-
with gr.
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
| 174 |
|
| 175 |
gr.Examples(
|
| 176 |
examples=[
|
|
@@ -194,27 +201,31 @@ with gr.Blocks() as demo_s2tt:
|
|
| 194 |
)
|
| 195 |
|
| 196 |
with gr.Blocks() as demo_t2st:
|
| 197 |
-
with gr.
|
| 198 |
-
with gr.
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
|
| 219 |
gr.Examples(
|
| 220 |
examples=[
|
|
@@ -255,21 +266,24 @@ with gr.Blocks() as demo_t2st:
|
|
| 255 |
)
|
| 256 |
|
| 257 |
with gr.Blocks() as demo_t2tt:
|
| 258 |
-
with gr.
|
| 259 |
-
with gr.
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
|
|
|
|
|
|
|
|
|
| 273 |
|
| 274 |
gr.Examples(
|
| 275 |
examples=[
|
|
@@ -310,15 +324,18 @@ with gr.Blocks() as demo_t2tt:
|
|
| 310 |
)
|
| 311 |
|
| 312 |
with gr.Blocks() as demo_asr:
|
| 313 |
-
with gr.
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
|
|
|
|
|
|
|
|
|
| 322 |
|
| 323 |
gr.Examples(
|
| 324 |
examples=[
|
|
|
|
| 124 |
|
| 125 |
|
| 126 |
with gr.Blocks() as demo_s2st:
|
| 127 |
+
with gr.Row():
|
| 128 |
+
with gr.Column():
|
| 129 |
+
with gr.Group():
|
| 130 |
+
target_language = gr.Dropdown(
|
| 131 |
+
label="Target language",
|
| 132 |
+
choices=S2ST_TARGET_LANGUAGE_NAMES,
|
| 133 |
+
value=DEFAULT_TARGET_LANGUAGE,
|
| 134 |
+
)
|
| 135 |
+
input_audio = gr.Audio(label="Input speech", type="filepath")
|
| 136 |
+
btn = gr.Button("Translate")
|
| 137 |
+
with gr.Column():
|
| 138 |
+
with gr.Group():
|
| 139 |
+
output_audio = gr.Audio(
|
| 140 |
+
label="Translated speech",
|
| 141 |
+
autoplay=False,
|
| 142 |
+
streaming=False,
|
| 143 |
+
type="numpy",
|
| 144 |
+
)
|
| 145 |
+
output_text = gr.Textbox(label="Translated text")
|
| 146 |
|
| 147 |
gr.Examples(
|
| 148 |
examples=[
|
|
|
|
| 166 |
)
|
| 167 |
|
| 168 |
with gr.Blocks() as demo_s2tt:
|
| 169 |
+
with gr.Row():
|
| 170 |
+
with gr.Column():
|
| 171 |
+
with gr.Group():
|
| 172 |
+
target_language = gr.Dropdown(
|
| 173 |
+
label="Target language",
|
| 174 |
+
choices=S2TT_TARGET_LANGUAGE_NAMES,
|
| 175 |
+
value=DEFAULT_TARGET_LANGUAGE,
|
| 176 |
+
)
|
| 177 |
+
input_audio = gr.Audio(label="Input speech", type="filepath")
|
| 178 |
+
btn = gr.Button("Translate")
|
| 179 |
+
with gr.Column():
|
| 180 |
+
output_text = gr.Textbox(label="Translated text")
|
| 181 |
|
| 182 |
gr.Examples(
|
| 183 |
examples=[
|
|
|
|
| 201 |
)
|
| 202 |
|
| 203 |
with gr.Blocks() as demo_t2st:
|
| 204 |
+
with gr.Row():
|
| 205 |
+
with gr.Column():
|
| 206 |
+
with gr.Group():
|
| 207 |
+
with gr.Row():
|
| 208 |
+
source_language = gr.Dropdown(
|
| 209 |
+
label="Source language",
|
| 210 |
+
choices=TEXT_SOURCE_LANGUAGE_NAMES,
|
| 211 |
+
value="English",
|
| 212 |
+
)
|
| 213 |
+
target_language = gr.Dropdown(
|
| 214 |
+
label="Target language",
|
| 215 |
+
choices=T2ST_TARGET_LANGUAGE_NAMES,
|
| 216 |
+
value=DEFAULT_TARGET_LANGUAGE,
|
| 217 |
+
)
|
| 218 |
+
input_text = gr.Textbox(label="Input text")
|
| 219 |
+
btn = gr.Button("Translate")
|
| 220 |
+
with gr.Column():
|
| 221 |
+
with gr.Group():
|
| 222 |
+
output_audio = gr.Audio(
|
| 223 |
+
label="Translated speech",
|
| 224 |
+
autoplay=False,
|
| 225 |
+
streaming=False,
|
| 226 |
+
type="numpy",
|
| 227 |
+
)
|
| 228 |
+
output_text = gr.Textbox(label="Translated text")
|
| 229 |
|
| 230 |
gr.Examples(
|
| 231 |
examples=[
|
|
|
|
| 266 |
)
|
| 267 |
|
| 268 |
with gr.Blocks() as demo_t2tt:
|
| 269 |
+
with gr.Row():
|
| 270 |
+
with gr.Column():
|
| 271 |
+
with gr.Group():
|
| 272 |
+
with gr.Row():
|
| 273 |
+
source_language = gr.Dropdown(
|
| 274 |
+
label="Source language",
|
| 275 |
+
choices=TEXT_SOURCE_LANGUAGE_NAMES,
|
| 276 |
+
value="English",
|
| 277 |
+
)
|
| 278 |
+
target_language = gr.Dropdown(
|
| 279 |
+
label="Target language",
|
| 280 |
+
choices=T2TT_TARGET_LANGUAGE_NAMES,
|
| 281 |
+
value=DEFAULT_TARGET_LANGUAGE,
|
| 282 |
+
)
|
| 283 |
+
input_text = gr.Textbox(label="Input text")
|
| 284 |
+
btn = gr.Button("Translate")
|
| 285 |
+
with gr.Column():
|
| 286 |
+
output_text = gr.Textbox(label="Translated text")
|
| 287 |
|
| 288 |
gr.Examples(
|
| 289 |
examples=[
|
|
|
|
| 324 |
)
|
| 325 |
|
| 326 |
with gr.Blocks() as demo_asr:
|
| 327 |
+
with gr.Row():
|
| 328 |
+
with gr.Column():
|
| 329 |
+
with gr.Group():
|
| 330 |
+
target_language = gr.Dropdown(
|
| 331 |
+
label="Target language",
|
| 332 |
+
choices=ASR_TARGET_LANGUAGE_NAMES,
|
| 333 |
+
value=DEFAULT_TARGET_LANGUAGE,
|
| 334 |
+
)
|
| 335 |
+
input_audio = gr.Audio(label="Input speech", type="filepath")
|
| 336 |
+
btn = gr.Button("Translate")
|
| 337 |
+
with gr.Column():
|
| 338 |
+
output_text = gr.Textbox(label="Translated text")
|
| 339 |
|
| 340 |
gr.Examples(
|
| 341 |
examples=[
|
style.css
CHANGED
|
@@ -8,9 +8,3 @@ h1 {
|
|
| 8 |
background: #1565c0;
|
| 9 |
border-radius: 100vh;
|
| 10 |
}
|
| 11 |
-
|
| 12 |
-
.contain {
|
| 13 |
-
max-width: 730px;
|
| 14 |
-
margin: auto;
|
| 15 |
-
padding-top: 1.5rem;
|
| 16 |
-
}
|
|
|
|
| 8 |
background: #1565c0;
|
| 9 |
border-radius: 100vh;
|
| 10 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|