kaixindelele / ChatPaper

Use ChatGPT to summarize the arXiv papers. 全流程加速科研,利用chatgpt进行论文全文总结+专业翻译+润色+审稿+审稿回复
https://chatwithpaper.org
Other
18.52k stars 1.94k forks source link

Fix undefined "args" var in chat reviewer #293

Open SadPencil opened 7 months ago

SadPencil commented 7 months ago

目前的版本在命令行运行 chat_reviewer.py 会提示变量 args 未定义,经检查是代码本身的问题,此PR修复了此问题

(venv) root@VM-0-11-debian:~/ChatPaper/ChatReviewerAndResponse# python chat_reviewer.py --paper_path . 
root: . dirs: ['__pycache__', 'output_file'] files: ['review_comments.txt', 'ReviewFormat.txt', 'get_paper.py', 'README.md', 'chat_response.py', 'paper_file.pdf', 'chat_reviewer.py', 'apikey.ini']
root: ./__pycache__ dirs: [] files: ['get_paper.cpython-311.pyc']
root: ./output_file dirs: [] files: ['paper_title_secret.txt', 'paper_title_secret.txt']
------------------paper_num: 1------------------
0 ./paper_file.pdf
Traceback (most recent call last):
  File "/root/ChatPaper/ChatReviewerAndResponse/chat_reviewer.py", line 233, in <module>
    chat_reviewer_main(args=reviewer_args)
  File "/root/ChatPaper/ChatReviewerAndResponse/chat_reviewer.py", line 220, in chat_reviewer_main
    reviewer1.review_by_chatgpt(paper_list=paper_list)
  File "/root/ChatPaper/ChatReviewerAndResponse/chat_reviewer.py", line 91, in review_by_chatgpt
    sections_of_interest = self.stage_1(paper)
                           ^^^^^^^^^^^^^^^^^^^
  File "/root/ChatPaper/ChatReviewerAndResponse/chat_reviewer.py", line 138, in stage_1
    "content": f"You are a professional reviewer in the field of {args.research_fields}. "
                                                                  ^^^^
NameError: name 'args' is not defined