Spaces:
Runtime error
Runtime error
fuhsiao418
commited on
Commit
·
76f1e3b
1
Parent(s):
7831cfa
update
Browse files
app.py
CHANGED
|
@@ -34,21 +34,22 @@ def main(file, ext_threshold, article_type):
|
|
| 34 |
return result
|
| 35 |
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
| 34 |
return result
|
| 35 |
|
| 36 |
|
| 37 |
+
if __name__ == '__main__':
|
| 38 |
+
|
| 39 |
+
# 定義Gradio介面
|
| 40 |
+
iface = gr.Interface(
|
| 41 |
+
fn=main,
|
| 42 |
+
inputs=[
|
| 43 |
+
gr.inputs.File(),
|
| 44 |
+
gr.inputs.Slider(minimum=0.5, maximum=1, default=0.5, step=0.01, label="Extractive - Threshold"),
|
| 45 |
+
gr.inputs.Dropdown(["non-specialized field", "biomedical field"],default="non-specialized field", label="Abstractive - Field")
|
| 46 |
+
],
|
| 47 |
+
outputs=gr.outputs.Textbox(label="Output - Structured Abstract"),
|
| 48 |
+
title="Ext-Abs-StructuredSum",
|
| 49 |
+
description="please upload a .txt file formatted in the form of the example.",
|
| 50 |
+
# examples=[['text.txt']],
|
| 51 |
+
allow_flagging='never'
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
# 啟動Gradio介面
|
| 55 |
+
iface.launch(share=False) # share=False 用於停用分享模式
|