File size: 370 Bytes
21c0ebb
 
ddc19ac
88826f7
21c0ebb
 
88826f7
21c0ebb
960a49c
0291eb5
1
2
3
4
5
6
7
8
9
10
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)