D:/PythonProjects/my_glm2-6b/ChatGLM2-6B/openai_api.py:173: PydanticDeprecatedSince20: The json method is deprecated; use model_dump_json instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.0.3/migration/
yield "{}".format(chunk.json(exclude_unset=True, ensure_ascii=False))
ERROR: Exception in ASGI application
replace
yield "{}".format(chunk.json(exclude_unset=True, ensure_ascii=False))
with
json.dumps(chunk.model_dump(exclude_unset=True), ensure_ascii=False)
works
Is there an existing issue for this?
Current Behavior
D:/PythonProjects/my_glm2-6b/ChatGLM2-6B/openai_api.py:173: PydanticDeprecatedSince20: The
json
method is deprecated; usemodel_dump_json
instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.0.3/migration/ yield "{}".format(chunk.json(exclude_unset=True, ensure_ascii=False)) ERROR: Exception in ASGI applicationExpected Behavior
none
Steps To Reproduce
Name: pydantic Version: 2.0.3
Environment
Anything else?
https://github.com/THUDM/ChatGLM2-6B/issues/308 don't work
replace yield "{}".format(chunk.json(exclude_unset=True, ensure_ascii=False)) with json.dumps(chunk.model_dump(exclude_unset=True), ensure_ascii=False) works