Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ def summarize(file, text, style, length):
|
|
29 |
if file is not None:
|
30 |
if file.name.endswith(".pdf"):
|
31 |
with fitz.open(stream=file.read(), filetype="pdf") as doc:
|
32 |
-
|
33 |
elif file.name.endswith(".txt"):
|
34 |
text_input = file.read().decode("utf-8")
|
35 |
elif text:
|
|
|
29 |
if file is not None:
|
30 |
if file.name.endswith(".pdf"):
|
31 |
with fitz.open(stream=file.read(), filetype="pdf") as doc:
|
32 |
+
text_input = " ".join([page.get_text() for page in doc])
|
33 |
elif file.name.endswith(".txt"):
|
34 |
text_input = file.read().decode("utf-8")
|
35 |
elif text:
|