Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undefined "args" var in chat reviewer #293

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SadPencil
Copy link

目前的版本在命令行运行 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant