Spaces:
Runtime error
Runtime error
Name or import fixes
Browse files- app.py +1 -1
- papers.py +2 -3
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -16,7 +16,7 @@ from kokoro import KModel, KPipeline
|
|
| 16 |
# -----------------------------------------------------------------------------
|
| 17 |
from papers import PaperManager
|
| 18 |
|
| 19 |
-
|
| 20 |
top_papers = paper_manager.get_top_content()
|
| 21 |
print("TOP PAPERS", top_papers)
|
| 22 |
|
|
|
|
| 16 |
# -----------------------------------------------------------------------------
|
| 17 |
from papers import PaperManager
|
| 18 |
|
| 19 |
+
paper_manager = PaperManager()
|
| 20 |
top_papers = paper_manager.get_top_content()
|
| 21 |
print("TOP PAPERS", top_papers)
|
| 22 |
|
papers.py
CHANGED
|
@@ -4,7 +4,7 @@ import tempfile
|
|
| 4 |
from datetime import datetime, timezone
|
| 5 |
import base64
|
| 6 |
from tqdm.auto import tqdm
|
| 7 |
-
import
|
| 8 |
|
| 9 |
DAILY_PAPERS_API_URL = "https://huggingface.co/api/daily_papers"
|
| 10 |
|
|
@@ -98,8 +98,7 @@ class PaperManager:
|
|
| 98 |
with open("temp.pdf", "wb") as f:
|
| 99 |
f.write(response.content)
|
| 100 |
|
| 101 |
-
|
| 102 |
-
with PyMuPDF.open("temp.pdf") as doc:
|
| 103 |
text = ""
|
| 104 |
for page in doc:
|
| 105 |
text += page.get_text()
|
|
|
|
| 4 |
from datetime import datetime, timezone
|
| 5 |
import base64
|
| 6 |
from tqdm.auto import tqdm
|
| 7 |
+
import pymupdf
|
| 8 |
|
| 9 |
DAILY_PAPERS_API_URL = "https://huggingface.co/api/daily_papers"
|
| 10 |
|
|
|
|
| 98 |
with open("temp.pdf", "wb") as f:
|
| 99 |
f.write(response.content)
|
| 100 |
|
| 101 |
+
with pymupdf.open("temp.pdf") as doc:
|
|
|
|
| 102 |
text = ""
|
| 103 |
for page in doc:
|
| 104 |
text += page.get_text()
|
requirements.txt
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
kokoro
|
| 2 |
huggingface_hub
|
| 3 |
transformers
|
| 4 |
-
PyMuPDF
|
|
|
|
|
|
| 1 |
kokoro
|
| 2 |
huggingface_hub
|
| 3 |
transformers
|
| 4 |
+
PyMuPDF
|
| 5 |
+
soundfile
|