ShiwenNi commited on
Commit
180a6c8
1 Parent(s): 7a6b087

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -62,8 +62,9 @@ class Reviewer:
62
  return result, response.usage.total_tokens
63
 
64
  def extract_chapter(self, pdf_path):
 
65
  # 创建一个PDF阅读器对象
66
- pdf_reader = PyPDF2.PdfReader(pdf_path)
67
  # 获取PDF的总页数
68
  num_pages = len(pdf_reader.pages)
69
  # 初始化提取状态和提取文本
 
62
  return result, response.usage.total_tokens
63
 
64
  def extract_chapter(self, pdf_path):
65
+ file_object = io.BytesIO(pdf_path)
66
  # 创建一个PDF阅读器对象
67
+ pdf_reader = PyPDF2.PdfReader(file_object)
68
  # 获取PDF的总页数
69
  num_pages = len(pdf_reader.pages)
70
  # 初始化提取状态和提取文本