Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,15 +26,15 @@ def summarize_text(input_text):
|
|
26 |
summarized_text = "\n".join(summarized_chunks)
|
27 |
return summarized_text
|
28 |
|
29 |
-
def read_file(
|
30 |
-
with open(
|
31 |
-
content =
|
32 |
return content
|
33 |
|
34 |
|
35 |
def summarize_text_file(file):
|
36 |
if file is not None:
|
37 |
-
content = read_file(file
|
38 |
return summarize_text(content)
|
39 |
|
40 |
input_type = gr.inputs.File("text")
|
|
|
26 |
summarized_text = "\n".join(summarized_chunks)
|
27 |
return summarized_text
|
28 |
|
29 |
+
def read_file(file):
|
30 |
+
with open(file.name, 'r') as file_:
|
31 |
+
content = file_.read()
|
32 |
return content
|
33 |
|
34 |
|
35 |
def summarize_text_file(file):
|
36 |
if file is not None:
|
37 |
+
content = read_file(file)
|
38 |
return summarize_text(content)
|
39 |
|
40 |
input_type = gr.inputs.File("text")
|