File size: 440 Bytes
9aad3f0
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import sentencepiece
from transformers import pipeline
translator = pipeline("translation",model="Helsinki-NLP/opus-mt-fr-en")

import gradio as gr

def translation (text):
  traduction = translator(text)
  return traduction[0]["translation_text"]

demo = gr.Interface(translation, title= "TRADUCTION", inputs = "text", outputs = "text", description = "Traduisons ce texte du français vers l'anglais ! Allons y")
demo.launch(quiet = True)