LEWOPO commited on
Commit
1892cb4
·
verified ·
1 Parent(s): a586547

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sentencepiece
2
+ from transformers import pipeline
3
+ import gradio as gr
4
+ translator=pipeline("translation",model='Helsinki-NLP/opus-mt-fr-en')
5
+
6
+ def Get_Translation(input_text):
7
+ texte=translator(input_text)
8
+ result= texte[0]['translation_text']
9
+ return result
10
+
11
+ iface = gr.Interface(fn=Get_Translation,title='Text Translation',inputs='text',outputs='text',description='Get translation of giving input').launch()