vonewman commited on
Commit
01a6864
1 Parent(s): 0d82d3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
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
- """Get a sentence in french.
9
- And return his translation in english
10
- """
11
- for value in translator(input_text)[0].values:
12
- return value
13
 
14
- iface = gr.Interface(fn = translate_sentence, inputs = 'text', output = 'text',
15
- title = "Traduction EN-FR",
16
- description = "Un mini google translate avec HuggingFace")
 
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)