Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import numpy as np
|
2 |
import os
|
3 |
import re
|
4 |
-
import
|
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 =
|
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="选择输出语言"),
|