import gradio as gr from transformers import pipeline calculator = pipeline('text2text-generation', model='el-filatova/mbart-gsm8k') def predict(text): return calculator(text)[0]['generated_text'] iface = gr.Interface(fn=predict, inputs=[gr.Textbox(value="I have two apples and four oranges. How many fruits do I have?")], outputs="text") iface.launch(share=True)