File size: 496 Bytes
08813b3
 
 
 
 
 
daebf08
08813b3
 
bab8245
1
2
3
4
5
6
7
8
9
10
from transformers import pipeline
import gradio as gr

translator = pipeline('text2text-generation', model='edgilr/mbart-neutralization')

def predict(txt):
    return translator(txt)[0]['generated_text']
    
gr.Interface(fn=predict, inputs="text", outputs="text",
             examples=['You are an AI assistant. User will you give you a task. Your goal is to complete the task as faithfully as you can. While performing the task think step-by-step and justify your steps.']).launch(share=True)