Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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()
|