Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
from transformers import pipeline
|
4 |
-
|
5 |
|
6 |
def predict(text):
|
7 |
-
return
|
8 |
|
9 |
iface = gr.Interface(fn=predict, inputs=[gr.Textbox(value="Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?")], outputs="text")
|
10 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
from transformers import pipeline
|
4 |
+
calculator = pipeline('text2text-generation', model='el-filatova/mbart-gsm8k')
|
5 |
|
6 |
def predict(text):
|
7 |
+
return calculator(text)[0]['generated_text']
|
8 |
|
9 |
iface = gr.Interface(fn=predict, inputs=[gr.Textbox(value="Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?")], outputs="text")
|
10 |
iface.launch()
|