Spaces:
Runtime error
Runtime error
Commit
·
1b9db30
1
Parent(s):
b309611
Update app.py
Browse files
app.py
CHANGED
@@ -63,21 +63,6 @@ def para_t5(text):
|
|
63 |
for output in outputs
|
64 |
]
|
65 |
|
66 |
-
t5_demo = gr.Interface(
|
67 |
-
fn=summ_t5,
|
68 |
-
inputs="text",
|
69 |
-
outputs=gr.Textbox(lines=10, label="T5 Base Output")
|
70 |
-
)
|
71 |
-
bert_demo = gr.Interface(
|
72 |
-
fn=summ_bert,
|
73 |
-
inputs="text",
|
74 |
-
outputs=gr.Textbox(lines=10, label="Bert2Bert Base Output")
|
75 |
-
)
|
76 |
-
para_demo = gr.Interface(
|
77 |
-
fn=para_t5,
|
78 |
-
inputs="text",
|
79 |
-
outputs=gr.Textbox(lines=10, label="T5 Paraphrase Output")
|
80 |
-
)
|
81 |
def summarize(text):
|
82 |
t5_ = summ_t5(text)
|
83 |
bert_ = summ_bert(text)
|
@@ -85,10 +70,7 @@ def summarize(text):
|
|
85 |
return t5_, bert_, para_
|
86 |
|
87 |
if __name__ == "__main__":
|
88 |
-
|
89 |
-
#inputs=gr.Textbox(lines=10, label="Input Text", placeholder="Enter article here..."),
|
90 |
-
#title="Summary of Summarizer - Indonesia").launch()
|
91 |
-
with gr.Blocks():
|
92 |
with gr.Row():
|
93 |
with gr.Column():
|
94 |
input_text = gr.Textbox(label="Input Text")
|
@@ -97,4 +79,5 @@ if __name__ == "__main__":
|
|
97 |
t5_output = gr.Label(label="T5 Base Output")
|
98 |
bert_output = gr.Textbox(label="Bert Base Output")
|
99 |
para_output = gr.Textbox(label="T5 Paraphrase Output")
|
100 |
-
|
|
|
|
63 |
for output in outputs
|
64 |
]
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
def summarize(text):
|
67 |
t5_ = summ_t5(text)
|
68 |
bert_ = summ_bert(text)
|
|
|
70 |
return t5_, bert_, para_
|
71 |
|
72 |
if __name__ == "__main__":
|
73 |
+
with gr.Blocks() as demo:
|
|
|
|
|
|
|
74 |
with gr.Row():
|
75 |
with gr.Column():
|
76 |
input_text = gr.Textbox(label="Input Text")
|
|
|
79 |
t5_output = gr.Label(label="T5 Base Output")
|
80 |
bert_output = gr.Textbox(label="Bert Base Output")
|
81 |
para_output = gr.Textbox(label="T5 Paraphrase Output")
|
82 |
+
analyze_button.click(summarize, input_text, [t5_output, bert_output, para_output])
|
83 |
+
demo.launch()
|