File size: 362 Bytes
ac7c080
 
 
 
 
 
 
 
 
 
8835e10
ac7c080
e8355c3
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr
from transformers import pipeline

def greet(text):
    translation  = pipeline('text2text-generation', model='ancebuc/mbart-translation-en-ro')
    response = translation(text)[0]['generated_text']

    return response

iface = gr.Interface(fn=greet, 
                     inputs="text", 
                     outputs="text")
iface.launch()