Fix undefined "args" var in chat reviewer #293
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
目前的版本在命令行运行
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