Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,4 +25,24 @@ examples = [
|
|
| 25 |
A: Roger started with 5 balls. 2 cans of 3 tennis balls each is 6 tennis balls. 5 + 6 = 11. The answer is 11.
|
| 26 |
Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there?"""]
|
| 27 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
io.launch()
|
|
|
|
| 25 |
A: Roger started with 5 balls. 2 cans of 3 tennis balls each is 6 tennis balls. 5 + 6 = 11. The answer is 11.
|
| 26 |
Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there?"""]
|
| 27 |
]
|
| 28 |
+
|
| 29 |
+
title = "Flan T5 and Vanilla T5"
|
| 30 |
+
description = "This demo compares [T5-large](https://huggingface.co/t5-large) and [Flan-T5-XX-large](https://huggingface.co/google/flan-t5-xxl). Note that T5 expects a very specific format of the prompts, so the examples below are not necessarily the best prompts to compare."
|
| 31 |
+
|
| 32 |
+
def inference(text):
|
| 33 |
+
output_flan = pipe_flan(text, max_length=100)[0]["generated_text"]
|
| 34 |
+
output_vanilla = pipe_vanilla(text, max_length=100)[0]["generated_text"]
|
| 35 |
+
return [output_flan, output_vanilla]
|
| 36 |
+
|
| 37 |
+
io = gr.Interface(
|
| 38 |
+
inference,
|
| 39 |
+
gr.Textbox(lines=3),
|
| 40 |
+
outputs=[
|
| 41 |
+
gr.Textbox(lines=3, label="Flan T5"),
|
| 42 |
+
gr.Textbox(lines=3, label="T5")
|
| 43 |
+
],
|
| 44 |
+
title=title,
|
| 45 |
+
description=description,
|
| 46 |
+
examples=examples
|
| 47 |
+
)
|
| 48 |
io.launch()
|