Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
|
4 |
-
|
5 |
|
6 |
def bart(text):
|
7 |
#results = inductor.generate(text)
|
@@ -10,11 +10,21 @@ def bart(text):
|
|
10 |
results_dict = {result[0]: float(result[1]) for result in results}
|
11 |
return results_dict
|
12 |
|
13 |
-
|
14 |
inputs=gr.inputs.Textbox(default='<mask> is the capital of <mask>.'),
|
15 |
outputs=gr.Label(),
|
16 |
title="BART Inductor",
|
17 |
examples=[['<mask> is the capital of <mask>.']],
|
18 |
description="Enter a text prompt to generate text using BART.")
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from inductor import BartInductor
|
3 |
|
4 |
+
inductor = BartInductor()
|
5 |
|
6 |
def bart(text):
|
7 |
#results = inductor.generate(text)
|
|
|
10 |
results_dict = {result[0]: float(result[1]) for result in results}
|
11 |
return results_dict
|
12 |
|
13 |
+
bivar = gr.Interface(fn=bart,
|
14 |
inputs=gr.inputs.Textbox(default='<mask> is the capital of <mask>.'),
|
15 |
outputs=gr.Label(),
|
16 |
title="BART Inductor",
|
17 |
examples=[['<mask> is the capital of <mask>.']],
|
18 |
description="Enter a text prompt to generate text using BART.")
|
19 |
|
20 |
+
trivar = gr.Interface(fn=bart,
|
21 |
+
inputs=gr.inputs.Textbox(default='<mask> is the capital of <mask>.'),
|
22 |
+
outputs=gr.Label(),
|
23 |
+
title="BART Inductor",
|
24 |
+
examples=[['<mask> is the capital of <mask>.']],
|
25 |
+
description="Enter a text prompt to generate text using BART.")
|
26 |
+
|
27 |
+
demo = gr.TabbedInterface([bivar, stt_demo], ["εει", "δΈει"])
|
28 |
+
|
29 |
+
if __name__ == "__main__":
|
30 |
+
demo.launch()
|