Skip to content
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

When uploading with Cog i get a pydantic error #401

Open
micos7 opened this issue Aug 30, 2024 · 1 comment
Open

When uploading with Cog i get a pydantic error #401

micos7 opened this issue Aug 30, 2024 · 1 comment

Comments

@micos7
Copy link

micos7 commented Aug 30, 2024

Validating 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 "/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/cog/command/openapi_schema.py", line 46, in <module>
    raise CogError(app.state.setup_result.logs)
cog.errors.CogError: Error while loading predictor:

Traceback (most recent call last):
  File "/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/cog/server/http.py", line 130, in create_app
    predictor = load_slim_predictor_from_ref(predictor_ref, "predict")
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/cog/predictor.py", line 242, in load_slim_predictor_from_ref
    module = load_full_predictor_from_file(module_path, module_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/cog/predictor.py", line 202, in load_full_predictor_from_file
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/src/predict.py", line 29, in <module>
    from fooocusapi.parameters import ImageGenerationParams
  File "/src/fooocusapi/parameters.py", line 5, in <module>
    from fooocusapi.models.common.base import EnhanceCtrlNets
  File "/src/fooocusapi/models/common/base.py", line 6, in <module>
    from pydantic import (
**ImportError: cannot import name 'TypeAdapter' from 'pydantic' (/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/pydantic/__init__.cpython-311-x86_64-linux-gnu.so)**

Thanks for your work

EDIT:

Apparently this is an error with pydantic < 2 but in requirements it is already > 2. Confused.

EDIT2:

This is related to replicate/cog#1562

@mrhan1993
Copy link
Owner

Cog's version requirements for pydantic are too low, which is an incompatibility issue. But now the latest version of Cog seems to have upgraded its dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants