You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[...]#14 DONE 0.7sValidating model schema...Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/local/lib/python3.12/site-packages/cog/command/openapi_schema.py", line 13, in <module> from ..server.http import create_app File "/usr/local/lib/python3.12/site-packages/cog/server/http.py", line 18, in <module> from fastapi import Body, FastAPI, Header, Path, Response File "/usr/local/lib/python3.12/site-packages/fastapi/__init__.py", line 7, in <module> from .applications import FastAPI as FastAPI File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 16, in <module> from fastapi import routing File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 22, in <module> from fastapi import params File "/usr/local/lib/python3.12/site-packages/fastapi/params.py", line 4, in <module> from pydantic.fields import FieldInfo, UndefinedImportError: cannot import name 'Undefined' from 'pydantic.fields' (/usr/local/lib/python3.12/site-packages/pydantic/fields.py)ⅹ Failed to get type signature: exit status 1
As far as I can tell the problem here is that fastapi==0.98 is installed by default in the cog-base images, but this is actually not compatible with Pydantic v2.
It's possible to make a working image by specifying a tighter range of acceptable versions for fastapi, but I don't think this is ideal for users:
I encountered today the surprising fact that the following
cog.yaml
results in a broken image:The build fails with the following error:
As far as I can tell the problem here is that
fastapi==0.98
is installed by default in thecog-base
images, but this is actually not compatible with Pydantic v2.It's possible to make a working image by specifying a tighter range of acceptable versions for
fastapi
, but I don't think this is ideal for users:The text was updated successfully, but these errors were encountered: