fix(the ".PDF" file can not be recognized):

This commit is contained in:
欧玮杰 2023-03-31 10:26:40 +08:00
parent fefe96144f
commit 8f4f13efd5

View File

@ -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')