Update app.py
Browse filesChanged textbox labels.
app.py
CHANGED
@@ -12,17 +12,19 @@ def translate(text):
|
|
12 |
Translate the text from source lang fr to target lang br
|
13 |
"""
|
14 |
translation_pipeline = pipeline("translation", model=model, tokenizer=tokenizer, src_lang='fr', tgt_lang='br', max_length=400, device="cpu")
|
15 |
-
result = translation_pipeline(text)
|
16 |
return result[0]['translation_text']
|
17 |
|
18 |
demo = gr.Interface(
|
19 |
fn=translate,
|
20 |
inputs=[
|
21 |
-
gr.components.Textbox(label="
|
|
|
|
|
|
|
22 |
],
|
23 |
-
outputs=["text"],
|
24 |
cache_examples=False,
|
25 |
-
title="Gallek Translation Demo",
|
26 |
)
|
27 |
|
28 |
demo.launch()
|
|
|
12 |
Translate the text from source lang fr to target lang br
|
13 |
"""
|
14 |
translation_pipeline = pipeline("translation", model=model, tokenizer=tokenizer, src_lang='fr', tgt_lang='br', max_length=400, device="cpu")
|
15 |
+
result = translation_pipeline("traduis de français en breton: " + text)
|
16 |
return result[0]['translation_text']
|
17 |
|
18 |
demo = gr.Interface(
|
19 |
fn=translate,
|
20 |
inputs=[
|
21 |
+
gr.components.Textbox(label="French"),
|
22 |
+
],
|
23 |
+
outputs=[
|
24 |
+
gr.components.Textbox(label="Breton")
|
25 |
],
|
|
|
26 |
cache_examples=False,
|
27 |
+
title="Gallek French -> Breton Translation Demo",
|
28 |
)
|
29 |
|
30 |
demo.launch()
|