Update app.py
Browse files
app.py
CHANGED
@@ -5,13 +5,11 @@ from transformers import pipeline
|
|
5 |
translator = pipeline("translation", model="Helsinki-NLP/opus-mt-en-fr")
|
6 |
|
7 |
def translate_sentence(input_text):
|
8 |
-
|
9 |
-
|
10 |
-
"""
|
11 |
-
for value in translator(input_text)[0].values:
|
12 |
-
return value
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
17 |
iface.launch(inline = False)
|
|
|
5 |
translator = pipeline("translation", model="Helsinki-NLP/opus-mt-en-fr")
|
6 |
|
7 |
def translate_sentence(input_text):
|
8 |
+
for value in translator(input_text)[0].values():
|
9 |
+
return value
|
|
|
|
|
|
|
10 |
|
11 |
+
iface = gr.Interface(fn = translate_sentence, inputs = 'text', outputs = 'text',
|
12 |
+
title = "Traduction EN-FR",
|
13 |
+
description="Un mini google translate avec huggingface")
|
14 |
+
|
15 |
iface.launch(inline = False)
|