cog icon indicating copy to clipboard operation
cog copied to clipboard

cog issue when push model to replicate

Open aros0918 opened this issue 11 months ago • 0 comments

I have an ai model. and I am trying to push the model by using cog.yaml and predict.py. but at the end of the process, I got this error message. They always ask me pydantic module error, but I have already installed that on the docker. what is the problem? plz help me

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 25, in raise CogError(app.state.setup_result.logs) cog.errors.CogError: Error while loading predictor:

Traceback (most recent call last): File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/cog/server/http.py", line 137, in create_app predictor = load_predictor_from_ref(predictor_ref) File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/cog/predictor.py", line 187, in load_predictor_from_ref spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/src/predict.py", line 1, in import gradio as gr File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/gradio/init.py", line 3, in import gradio._simple_templates File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/gradio/_simple_templates/init.py", line 1, in from .simpledropdown import SimpleDropdown File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/gradio/_simple_templates/simpledropdown.py", line 6, in from gradio.components.base import FormComponent File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/gradio/components/init.py", line 1, in from gradio.components.annotated_image import AnnotatedImage File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/gradio/components/annotated_image.py", line 13, in from gradio import processing_utils, utils File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/gradio/processing_utils.py", line 21, in from gradio import utils, wasm_utils File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/gradio/utils.py", line 48, in from gradio.data_classes import FileData File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/gradio/data_classes.py", line 18, in from pydantic import BaseModel, RootModel, ValidationError ImportError: cannot import name 'RootModel' from 'pydantic' (/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/pydantic/init.cpython-310-x86_64-linux-gnu.so)

aros0918 avatar Mar 19 '24 10:03 aros0918