Spaces:
Running
Running
wangrongsheng
commited on
Commit
•
7ae2008
1
Parent(s):
5663101
Update app.py
Browse files
app.py
CHANGED
@@ -637,8 +637,8 @@ def upload_pdf(key, text, file):
|
|
637 |
if not key or not text or not file:
|
638 |
return "两个输入都不能为空,请输入字符并上传 PDF 文件!"
|
639 |
# 判断PDF文件
|
640 |
-
if file and file.name.split(".")[-1].lower() != "pdf":
|
641 |
-
|
642 |
else:
|
643 |
section_list = text.split(',')
|
644 |
paper_list = [Paper(path=file, sl=section_list)]
|
@@ -689,7 +689,7 @@ Use ChatGPT to summary the papers.Star our Github [🌟ChatPaper](https://github
|
|
689 |
ip = [
|
690 |
gradio.inputs.Textbox(label="请输入你的API-key(必填)", default="", type='password'),
|
691 |
gradio.inputs.Textbox(label="请输入论文大标题索引(用英文逗号隔开,必填)", default="'Abstract,Introduction,Related Work,Background,Preliminary,Problem Formulation,Methods,Methodology,Method,Approach,Approaches,Materials and Methods,Experiment Settings,Experiment,Experimental Results,Evaluation,Experiments,Results,Findings,Data Analysis,Discussion,Results and Discussion,Conclusion,References'"),
|
692 |
-
gradio.inputs.File(label="请上传论文PDF(必填)")
|
693 |
]
|
694 |
|
695 |
chatpaper_gui = gradio.Interface(fn=upload_pdf, inputs=ip, outputs="html", title=title, description=description)
|
|
|
637 |
if not key or not text or not file:
|
638 |
return "两个输入都不能为空,请输入字符并上传 PDF 文件!"
|
639 |
# 判断PDF文件
|
640 |
+
#if file and file.name.split(".")[-1].lower() != "pdf":
|
641 |
+
# return '请勿上传非 PDF 文件!'
|
642 |
else:
|
643 |
section_list = text.split(',')
|
644 |
paper_list = [Paper(path=file, sl=section_list)]
|
|
|
689 |
ip = [
|
690 |
gradio.inputs.Textbox(label="请输入你的API-key(必填)", default="", type='password'),
|
691 |
gradio.inputs.Textbox(label="请输入论文大标题索引(用英文逗号隔开,必填)", default="'Abstract,Introduction,Related Work,Background,Preliminary,Problem Formulation,Methods,Methodology,Method,Approach,Approaches,Materials and Methods,Experiment Settings,Experiment,Experimental Results,Evaluation,Experiments,Results,Findings,Data Analysis,Discussion,Results and Discussion,Conclusion,References'"),
|
692 |
+
gradio.inputs.File(label="请上传论文PDF(必填)", file_types=['.pdf'])
|
693 |
]
|
694 |
|
695 |
chatpaper_gui = gradio.Interface(fn=upload_pdf, inputs=ip, outputs="html", title=title, description=description)
|