MaoXiaoYuZ / Long-Novel-GPT

Long-Novel-GPT是一个基于GPT等大语言模型的长篇小说生成器。它采用层次化的大纲/章节/正文结构,以把握长篇小说的连贯剧情,通过上下文管理优化API调用成本,并根据自身或用户反馈不断进行优化,直至达到预定目标。
242 stars 39 forks source link

设置时一直返回takes no keyword arguments #7

Closed yating1022 closed 6 months ago

yating1022 commented 6 months ago

AutoChatScript 运行python demo.py时都是正常,当运行python openai_api.py --server-port 8000然后在网页进行设置url时一直都是返回User:Say this is a test (ERROR)chatgpt:list() takes no keyword arguments

MaoXiaoYuZ commented 6 months ago

这个问题和issue#5类似。 这说明AutoChatScript没有正常运行,可以先尝试AutoChatScrpt仓库中的demo,确保其能运行。

yating1022 commented 6 months ago

这个问题和issue#5类似。 这说明AutoChatScript没有正常运行,可以先尝试AutoChatScrpt仓库中的demo,确保其能运行。

我的demo.py是正常运行的,就是设置的时候一直会出现User:Say this is a test (ERROR)chatgpt:list() takes no keyword arguments

MaoXiaoYuZ commented 6 months ago

确实有点奇怪,我无法复现这个错误,你能贴出控制台的错误信息吗,就是运行python demo/app.py的控制台下输出的错误,这里的错误信息更全面

yating1022 commented 6 months ago

确实有点奇怪,我无法复现这个错误,你能贴出控制台的错误信息吗,就是运行python demo/app.py的控制台下输出的错误,这里的错误信息更全面

(lngpt) E:\Long-Novel-GPT-main>python demo/app.py Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch(). Traceback (most recent call last): File "E:\Long-Novel-GPT-main\llm_api\chatgpt_api.py", line 134, in test_chatgpt_api response = list(stream)[-1][-1]['content'] ^^^^^^^^^^^^ File "E:\Long-Novel-GPT-main\llm_api\chatgpt_api.py", line 106, in stream_chat_with_chatgpt messages = ChatMessages(messages, model=model, currency_symbol='$') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Long-Novel-GPT-main\llm_api\chat_messages.py", line 20, in init super().init(*args, **kwargs) TypeError: list() takes no keyword arguments(lngpt) E:\Long-Novel-GPT-main>python demo/app.py Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch(). Traceback (most recent call last): File "E:\Long-Novel-GPT-main\llm_api\chatgpt_api.py", line 134, in test_chatgpt_api response = list(stream)[-1][-1]['content'] ^^^^^^^^^^^^ File "E:\Long-Novel-GPT-main\llm_api\chatgpt_api.py", line 106, in stream_chat_with_chatgpt messages = ChatMessages(messages, model=model, currency_symbol='$') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Long-Novel-GPT-main\llm_api\chat_messages.py", line 20, in init super().init(*args, **kwargs) TypeError: list() takes no keyword arguments ===============================这里是app.py控制台的信息=================================

我在运行app.py时,后台已经有运行 python openai_api.py --server-port 8000 了

================================================================================= E:\AutoChatScript-main>python demo.py Mouse clicked at (841, 951) 开始初始化... User(q to quit, r to resubmit): 你好 waiting submit button... submit button found! waiting submit button... submit button found! waiting submit button... submit button found! ChatGPT: 你好!有什么我可以帮助你的吗? User(q to quit, r to resubmit): 没事了,谢谢 waiting submit button... submit button found! waiting submit button... submit button found! waiting submit button... submit button found! ChatGPT: 不客气!如果有任何其他问题,随时告诉我。祝你一天愉快! User(q to quit, r to resubmit): ===================================这是demo的信息==================================== E:\AutoChatScript-main>python openai_api.py --server-port 8000 Mouse clicked at (749, 943) 开始初始化... INFO: Started server process [8476] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) ================================openai_api.py 控制台的信息===============================

MaoXiaoYuZ commented 6 months ago

之后我会推送更新,当然你也可以直接按如下修改: 将这行super().init(*args, **kwargs)改为super().init(*args)即可。

MaoXiaoYuZ commented 6 months ago

这是由于python版本导致的问题,经测试: Python 3.7.16(通过) Python 3.10.13 (通过) Python 3.11.8(错误) 总之是一个很奇怪的bug

yating1022 commented 6 months ago

这是由于python版本导致的问题,经测试: Python 3.7.16(通过) Python 3.10.13 (通过) Python 3.11.8(错误) 总之是一个很奇怪的bug

好的,十分感谢