Spaces:
Runtime error
Runtime error
Euclid-Jie
commited on
Commit
•
db8c8af
1
Parent(s):
125fa7c
fix(the ".PDF" file can not be recognized):
Browse files
crazy_functions/读文章写摘要.py
CHANGED
@@ -11,7 +11,7 @@ def 解析Paper(file_manifest, project_folder, top_p, temperature, chatbot, hist
|
|
11 |
if ".tex" in fp:
|
12 |
with open(fp, 'r', encoding='utf-8') as f:
|
13 |
file_content = f.read()
|
14 |
-
if ".pdf" in fp:
|
15 |
file_content = readPdf(fp)
|
16 |
file_content = BeautifulSoup(''.join(file_content), features="lxml").body.text.encode('gbk', 'ignore').decode('gbk')
|
17 |
|
|
|
11 |
if ".tex" in fp:
|
12 |
with open(fp, 'r', encoding='utf-8') as f:
|
13 |
file_content = f.read()
|
14 |
+
if ".pdf" in fp.lower():
|
15 |
file_content = readPdf(fp)
|
16 |
file_content = BeautifulSoup(''.join(file_content), features="lxml").body.text.encode('gbk', 'ignore').decode('gbk')
|
17 |
|