-
Notifications
You must be signed in to change notification settings - Fork 388
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
Exception in ASGI application #176
Comments
I have this same problem |
The dumps_kwargs keyword argument is no longer supported. This change was introduced in Pydantic library version 1.8.0. If you want to fix the code snippet above, you can follow these steps: file openchat/ochat/serving/openai_api_server.py
In summary, Pydantic no longer accepts the dumps_kwargs argument, and you should use json.dumps instead of chunk.json for serialization |
Thanks so much ill try your fix if it happens again i tried everything finally making sure all libarys were upto date which they werent despite being a fresh install, so i updated all the libarys for example "pydantic" and the rest and it fixed it... |
Hello All,
I installed openchat and openchat-ui on a ubuntu 23.04.
Unfortunatelly, when i ask a question on the web page, i have this error on the openchat ssh console :
During handling of the above exception, another exception occurred:
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 419, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
| return await self.app(scope, receive, send)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
| await super().call(scope, receive, send)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/applications.py", line 123, in call
| await self.middleware_stack(scope, receive, send)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
| raise exc
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
| await self.app(scope, receive, _send)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in call
| await self.app(scope, receive, send)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call
| await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/routing.py", line 762, in call
| await self.middleware_stack(scope, receive, send)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/routing.py", line 782, in app
| await route.handle(scope, receive, send)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
| await self.app(scope, receive, send)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
| await wrap_app_handling_exceptions(app, request)(scope, receive, send)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/routing.py", line 75, in app
| await response(scope, receive, send)
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/responses.py", line 254, in call
| async with anyio.create_task_group() as task_group:
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 678, in aexit
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/responses.py", line 257, in wrap
| await func()
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/starlette/responses.py", line 246, in stream_response
| async for chunk in self.body_iterator:
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/ochat/serving/openai_api_server.py", line 222, in completion_stream_generator
| yield f"data: {chunk.json(exclude_unset=True, ensure_ascii=False)}\n\n"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/home/ubuntu/miniconda3/envs/openchat/lib/python3.11/site-packages/pydantic/main.py", line 1056, in json
| raise TypeError('
dumps_kwargs
keyword arguments are no longer supported.')| TypeError:
dumps_kwargs
keyword arguments are no longer supported.+------------------------------------
Do you have an idea to solve this problem ?
Best regards
The text was updated successfully, but these errors were encountered: