-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
ImportError: cannot import name 'ReviewerParams' from 'chat_reviewer' #182
Comments
#180 +1 |
估计是合并版本的锅,在ChatPaper\chat_reviewer.py中直接把老版本的代码粘进去先就能用 `def chat_reviewer_main(args): from collections import namedtuple |
def chat_reviewer_main(args):
reviewer1 = Reviewer(args=args)
# 开始判断是路径还是文件:
paper_list = []
if args.paper_path.endswith(".pdf"):
paper_list.append(Paper(path=args.paper_path))
else:
for root, dirs, files in os.walk(args.paper_path):
print("root:", root, "dirs:", dirs, 'files:', files) # 当前目录路径
for filename in files:
# 如果找到PDF文件,则将其复制到目标文件夹中
if filename.endswith(".pdf"):
paper_list.append(Paper(path=os.path.join(root, filename)))
print("------------------paper_num: {}------------------".format(len(paper_list)))
[print(paper_index, paper_name.path.split('\\')[-1]) for paper_index, paper_name in enumerate(paper_list)]
reviewer1.review_by_chatgpt(paper_list=paper_list)
from collections import namedtuple
ReviewerParams = namedtuple(
"Params", ["paper_path", "file_format", "research_fields", "language"]
)
|
已经提交 PR #215, 等待 merge |
Traceback (most recent call last): File "E:\Lib\site-packages\flask\cli.py", line 218, in locate_app __import__(module_name) File "H:\ChatPaper\app.py", line 13, in <module> from chat_reviewer import ReviewerParams, chat_reviewer_main ImportError: cannot import name 'ReviewerParams' from 'chat_reviewer' (H:ChatPaper\chat_reviewer.py)
在chat_reviewer.py确实没有找到ReviewerParams函数。
The text was updated successfully, but these errors were encountered: