wenda-LLM / wenda

闻达:一个LLM调用平台。目标为针对特定环境的高效内容生成,同时考虑个人和中小企业的计算资源局限性,以及知识安全和私密性问题
GNU Affero General Public License v3.0
6.22k stars 809 forks source link

使用Baichuan2-13B-Chat 输入字符后反馈 'str' object has no attribute 'removesuffix' #499

Closed lhtpluto closed 9 months ago

lhtpluto commented 10 months ago

使用Baichuan2-13B-Chat 输入字符后反馈 'str' object has no attribute 'removesuffix'

模型加载完成 127.0.0.1:你好 ERROR: Exception in ASGI application Traceback (most recent call last): File "D:\temp ai\wenda\env\lib\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 254, in run_asgi result = await self.app(self.scope, self.asgi_receive, self.asgi_send) File "D:\temp ai\wenda\env\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in call return await self.app(scope, receive, send) File "D:\temp ai\wenda\env\lib\site-packages\fastapi\applications.py", line 284, in call await super().call(scope, receive, send) File "C:\Users\Ai\AppData\Roaming\Python\Python38\site-packages\starlette\applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "C:\Users\Ai\AppData\Roaming\Python\Python38\site-packages\starlette\middleware\errors.py", line 149, in call await self.app(scope, receive, send) File "C:\Users\Ai\AppData\Roaming\Python\Python38\site-packages\starlette\middleware\base.py", line 26, in call await self.app(scope, receive, send) File "C:\Users\Ai\AppData\Roaming\Python\Python38\site-packages\starlette\middleware\exceptions.py", line 79, in call raise exc File "C:\Users\Ai\AppData\Roaming\Python\Python38\site-packages\starlette\middleware\exceptions.py", line 68, in call await self.app(scope, receive, sender) File "D:\temp ai\wenda\env\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in call raise e File "D:\temp ai\wenda\env\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in call await self.app(scope, receive, send) File "C:\Users\Ai\AppData\Roaming\Python\Python38\site-packages\starlette\routing.py", line 718, in call await route.handle(scope, receive, send) File "C:\Users\Ai\AppData\Roaming\Python\Python38\site-packages\starlette\routing.py", line 341, in handle await self.app(scope, receive, send) File "C:\Users\Ai\AppData\Roaming\Python\Python38\site-packages\starlette\routing.py", line 82, in app await func(session) File "D:\temp ai\wenda\env\lib\site-packages\fastapi\routing.py", line 292, in app await dependant.call(**values) File "wenda.py", line 349, in websocket_endpoint raise e File "wenda.py", line 338, in websocket_endpoint for response in LLM.chat_one(prompt, history_formatted, max_length, top_p, temperature, data): File "D:\temp ai\wenda\llms\llm_baichuan.py", line 75, in chat_one yield generated_text.removesuffix("") AttributeError: 'str' object has no attribute 'removesuffix'

l15y commented 9 months ago

用新版Python 想知道具体问题可以去搜一下

lhtpluto commented 9 months ago

用新版Python 想知道具体问题可以去搜一下

非常感谢,问题解决