使用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'
使用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'