Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,15 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
| 3 |
from inductor import BartInductor
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
for text in generated_texts:
|
| 11 |
-
print(text)
|
| 12 |
-
except:
|
| 13 |
-
pass
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
iface = gr.Interface(fn=uppercase, inputs="text", outputs="text")
|
| 19 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from inductor import BartInductor
|
| 3 |
|
| 4 |
+
inductor = BartInductor()
|
| 5 |
+
|
| 6 |
+
def bart(text):
|
| 7 |
+
return inductor.generate(text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
iface = gr.Interface(fn=bart,
|
| 10 |
+
inputs=gr.inputs.Textbox(default='<mask> is the capital of <mask>.'),
|
| 11 |
+
outputs="text",
|
| 12 |
+
title="BART Inductor",
|
| 13 |
+
description="Enter a text prompt to generate text using BART.")
|
| 14 |
|
|
|
|
| 15 |
iface.launch()
|