Spaces:
Running
Running
wangrongsheng
commited on
Commit
•
d0bbce1
1
Parent(s):
18943dc
Upload app.py
Browse files
app.py
CHANGED
@@ -472,21 +472,6 @@ class Reader:
|
|
472 |
md_text = "\n".join(htmls)
|
473 |
|
474 |
return markdown.markdown(md_text)
|
475 |
-
# # 整合成一个文件,打包保存下来。
|
476 |
-
'''
|
477 |
-
date_str = str(datetime.datetime.now())[:13].replace(' ', '-')
|
478 |
-
try:
|
479 |
-
export_path = os.path.join(self.root_path, 'export')
|
480 |
-
os.makedirs(export_path)
|
481 |
-
except:
|
482 |
-
pass
|
483 |
-
mode = 'w' if paper_index == 0 else 'a'
|
484 |
-
file_name = os.path.join(export_path, date_str+'-'+self.validateTitle(paper.title)[:25]+"."+self.file_format)
|
485 |
-
self.export_to_markdown("\n".join(htmls), file_name=file_name, mode=mode)
|
486 |
-
htmls = []
|
487 |
-
'''
|
488 |
-
# file_name = os.path.join(export_path, date_str+'-'+self.validateTitle(paper.title)+".md")
|
489 |
-
# self.export_to_markdown("\n".join(htmls), file_name=file_name, mode=mode)
|
490 |
|
491 |
|
492 |
@tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, min=4, max=10),
|
@@ -631,9 +616,9 @@ title = "ChatPaper"
|
|
631 |
description = "<div align='center'>帮助您快速阅读论文</div>"
|
632 |
# 创建Gradio界面
|
633 |
ip = [
|
634 |
-
gradio.inputs.Textbox(label="请输入你的API-key", default=""),
|
635 |
-
gradio.inputs.Textbox(label="
|
636 |
-
gradio.inputs.File(label="
|
637 |
]
|
638 |
|
639 |
interface = gradio.Interface(fn=upload_pdf, inputs=ip, outputs="html", title=title, description=description)
|
|
|
472 |
md_text = "\n".join(htmls)
|
473 |
|
474 |
return markdown.markdown(md_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
475 |
|
476 |
|
477 |
@tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, min=4, max=10),
|
|
|
616 |
description = "<div align='center'>帮助您快速阅读论文</div>"
|
617 |
# 创建Gradio界面
|
618 |
ip = [
|
619 |
+
gradio.inputs.Textbox(label="请输入你的API-key(必填)", default=""),
|
620 |
+
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'"),
|
621 |
+
gradio.inputs.File(label="请上传论文PDF(必填)")
|
622 |
]
|
623 |
|
624 |
interface = gradio.Interface(fn=upload_pdf, inputs=ip, outputs="html", title=title, description=description)
|