Spaces:
Sleeping
Sleeping
fyj
commited on
Commit
·
20b6421
1
Parent(s):
4beafb9
add pdf content
Browse files
app.py
CHANGED
@@ -142,10 +142,11 @@ def main(api, review_format, paper_pdf, language):
|
|
142 |
# 创建一个Reader对象
|
143 |
reviewer1 = Reviewer(api, review_format, paper_pdf, language)
|
144 |
# 开始判断是路径还是文件:
|
|
|
145 |
comments, total_token_used = reviewer1.review_by_chatgpt(paper_list=paper_pdf)
|
146 |
time_used = time.time() - start_time
|
147 |
output2 ="使用token数:"+ str(total_token_used)+"\n花费时间:"+ str(round(time_used, 2)) +"秒"
|
148 |
-
return comments, output2
|
149 |
|
150 |
|
151 |
|
@@ -197,7 +198,7 @@ xxx"""
|
|
197 |
|
198 |
chat_reviewer_gui = gradio.Interface(fn=main,
|
199 |
inputs=inp,
|
200 |
-
outputs = [gradio.Textbox(lines=25, label="分析结果"), gradio.Textbox(lines=2, label="资源统计")],
|
201 |
title=title,
|
202 |
description=description)
|
203 |
|
|
|
142 |
# 创建一个Reader对象
|
143 |
reviewer1 = Reviewer(api, review_format, paper_pdf, language)
|
144 |
# 开始判断是路径还是文件:
|
145 |
+
text = reviewer1.extract_chapter(paper_pdf)
|
146 |
comments, total_token_used = reviewer1.review_by_chatgpt(paper_list=paper_pdf)
|
147 |
time_used = time.time() - start_time
|
148 |
output2 ="使用token数:"+ str(total_token_used)+"\n花费时间:"+ str(round(time_used, 2)) +"秒"
|
149 |
+
return comments, output2,text
|
150 |
|
151 |
|
152 |
|
|
|
198 |
|
199 |
chat_reviewer_gui = gradio.Interface(fn=main,
|
200 |
inputs=inp,
|
201 |
+
outputs = [gradio.Textbox(lines=25, label="分析结果"), gradio.Textbox(lines=2, label="资源统计"),gradio.Textbox(lines=100, label="文章内容")],
|
202 |
title=title,
|
203 |
description=description)
|
204 |
|