From db8c8afd74e75fe8bfbeecdf978e34f3ef8ba994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AC=A7=E7=8E=AE=E6=9D=B0?= Date: Fri, 31 Mar 2023 10:26:40 +0800 Subject: [PATCH] fix(the ".PDF" file can not be recognized): --- crazy_functions/读文章写摘要.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crazy_functions/读文章写摘要.py b/crazy_functions/读文章写摘要.py index 51ae683..4144d11 100644 --- a/crazy_functions/读文章写摘要.py +++ b/crazy_functions/读文章写摘要.py @@ -11,7 +11,7 @@ def 解析Paper(file_manifest, project_folder, top_p, temperature, chatbot, hist if ".tex" in fp: with open(fp, 'r', encoding='utf-8') as f: file_content = f.read() - if ".pdf" in fp: + if ".pdf" in fp.lower(): file_content = readPdf(fp) file_content = BeautifulSoup(''.join(file_content), features="lxml").body.text.encode('gbk', 'ignore').decode('gbk')