Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,23 +40,23 @@ def summarize_text(input_text):
|
|
| 40 |
return summarized_text
|
| 41 |
|
| 42 |
|
| 43 |
-
def read_file(file):
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
|
| 49 |
|
| 50 |
-
def summarize_text_file(file):
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
|
| 55 |
|
| 56 |
input_type = gr.inputs.TextBox("textbox" , lines = 15)
|
| 57 |
|
| 58 |
# Name the outputs using the label parameter and provide a download option
|
| 59 |
-
demo = gr.Interface(fn=
|
| 60 |
outputs=[gr.Textbox(label="Summarized Text")],
|
| 61 |
title = "Text Summarization",
|
| 62 |
description = "Summarize text using BART",
|
|
|
|
| 40 |
return summarized_text
|
| 41 |
|
| 42 |
|
| 43 |
+
# def read_file(file):
|
| 44 |
+
# print(file[0].name)
|
| 45 |
+
# with open(file[0].name, 'r') as file_:
|
| 46 |
+
# content = file_.read()
|
| 47 |
+
# return content
|
| 48 |
|
| 49 |
|
| 50 |
+
# def summarize_text_file(file):
|
| 51 |
+
# if file is not None:
|
| 52 |
+
# content = read_file(file)
|
| 53 |
+
# return summarize_text(content)
|
| 54 |
|
| 55 |
|
| 56 |
input_type = gr.inputs.TextBox("textbox" , lines = 15)
|
| 57 |
|
| 58 |
# Name the outputs using the label parameter and provide a download option
|
| 59 |
+
demo = gr.Interface(fn=summarize_text, inputs=input_type,
|
| 60 |
outputs=[gr.Textbox(label="Summarized Text")],
|
| 61 |
title = "Text Summarization",
|
| 62 |
description = "Summarize text using BART",
|