ShiwenNi commited on
Commit
e0cbd02
1 Parent(s): 7c82e91

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import numpy as np
2
  import os
3
  import re
4
- import io
5
  import datetime
6
  import time
7
  import openai, tenacity
@@ -63,7 +63,7 @@ class Reviewer:
63
  return result, response.usage.total_tokens
64
 
65
  def extract_chapter(self, pdf_path):
66
- file_object = io.BytesIO(pdf_path)
67
  # 创建一个PDF阅读器对象
68
  pdf_reader = PyPDF2.PdfReader(file_object)
69
  # 获取PDF的总页数
@@ -156,7 +156,7 @@ The questions should be formulated in a manner that, after the authors have answ
156
  The paper is scored on a scale of 1-10, with 10 being the full mark, and 6 stands for borderline accept. Then give the reason for your rating.
157
  xxx"""
158
  ),
159
- gradio.inputs.File(label="请上传论文PDF(必填)"),
160
  gradio.inputs.Radio(choices=["English", "Chinese"],
161
  default="English",
162
  label="选择输出语言"),
 
1
  import numpy as np
2
  import os
3
  import re
4
+ from io import BytesIO
5
  import datetime
6
  import time
7
  import openai, tenacity
 
63
  return result, response.usage.total_tokens
64
 
65
  def extract_chapter(self, pdf_path):
66
+ file_object = BytesIO(pdf_path)
67
  # 创建一个PDF阅读器对象
68
  pdf_reader = PyPDF2.PdfReader(file_object)
69
  # 获取PDF的总页数
 
156
  The paper is scored on a scale of 1-10, with 10 being the full mark, and 6 stands for borderline accept. Then give the reason for your rating.
157
  xxx"""
158
  ),
159
+ gradio.inputs.File(label="请上传论文PDF(必填)",type="bytes"),
160
  gradio.inputs.Radio(choices=["English", "Chinese"],
161
  default="English",
162
  label="选择输出语言"),