【bug】gradio ERROR: Exception in ASGI application pydantic.errors.PydanticSchemaGenerationError
环境
产生**错误**
的环境
python 3.8
gradio==4.8.0
fastapi==0.112.4
gradio-client==1.3.0
pydantic==2.9.2
pydantic-core==2.23.4
详情
错误详情
ERROR: Exception in ASGI application
Traceback (most recent call last):
....
pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'starlette.requests.Request'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
这是由于gradio
版本与pydantic
版本不匹配导致的错误。
解决方法
更新 gradio
版本
pip install gradio==4.43.0
目前只测试了4.43.0,最新版本并没有进行测试,可以自行尝试