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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ChatReviewerAndResponse/chat_reviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def __init__(self, args=None):
self.file_format = args.file_format
self.max_token_num = 4096
self.encoding = tiktoken.get_encoding("gpt2")
self.research_fields = args.research_fields

def validateTitle(self, title):
# 修正论文的路径格式
Expand Down Expand Up @@ -135,7 +136,7 @@ def stage_1(self, paper):
self.cur_api = 0 if self.cur_api >= len(self.chat_api_list)-1 else self.cur_api
messages = [
{"role": "system",
"content": f"You are a professional reviewer in the field of {args.research_fields}. "
"content": f"You are a professional reviewer in the field of {self.research_fields}. "
f"I will give you a paper. You need to review this paper and discuss the novelty and originality of ideas, correctness, clarity, the significance of results, potential impact and quality of the presentation. "
f"Due to the length limitations, I am only allowed to provide you the abstract, introduction, conclusion and at most two sections of this paper."
f"Now I will give you the title and abstract and the headings of potential sections. "
Expand Down Expand Up @@ -171,7 +172,7 @@ def chat_review(self, text):
with open('ReviewFormat.txt', 'r') as file: # 读取特定的审稿格式
review_format = file.read()
messages=[
{"role": "system", "content": "You are a professional reviewer in the field of "+args.research_fields+". Now I will give you a paper. You need to give a complete review opinion according to the following requirements and format:"+ review_format +" Please answer in {}.".format(self.language)},
{"role": "system", "content": "You are a professional reviewer in the field of "+self.research_fields+". Now I will give you a paper. You need to give a complete review opinion according to the following requirements and format:"+ review_format +" Please answer in {}.".format(self.language)},
{"role": "user", "content": input_text},
]

Expand Down