cog
cog copied to clipboard
build hangs on 'Validating model schema...'
With no other feedback?
Thanks
Seems related, I am getting this:
Traceback (most recent call last):
File "/root/.pyenv/versions/3.10.13/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/root/.pyenv/versions/3.10.13/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/cog/command/openapi_schema.py", line 10, in {import_path}
has been removed in V2.')
pydantic.errors.PydanticImportError: pydantic.error_wrappers:ErrorWrapper
has been removed in V2.
For further information visit https://errors.pydantic.dev/2.4/u/import-error
ⅹ Failed to get type signature: exit status 1
`Validating model schema...
Traceback (most recent call last):
File "/root/.pyenv/versions/3.10.13/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/root/.pyenv/versions/3.10.13/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/cog/command/openapi_schema.py", line 10, in
I am getting this. I am new to cog, I do not see the .pyenv folder in root
@happy-machine This step tries to import your predict.py, but doesn't run any setup or prediction functions. Are you doing anything time-consuming in predict.py?
@rdcoder33 @Sanawar21 currently, cog doesn't support pydantic>=2.0.0. You'll get this error if you use it in your requirements.txt
Ah yea this error just came up for me today too. Here's a quick workaround...in cog.yaml
just add a line in the run section that downgrades pydantic.
run:
# ...
- pip install "pydantic<2.0.0"
Of course this could be done in the python_packages
section but in my case pydantic gets installed in the run
as some dependency of something I installed there. So this would fix the issue either way (and avoids rebuilding the whole image at the cost of a slightly bigger image size, since each run command is cached separately).