[Python] Plot Bars in Gradio

Discussão em 'Python' iniciado por Stack, Janeiro 23, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to run the gradio app but getting error. The app runs, but I am not getting the graph after entering and clicking the button.

    I am getting this error.

    Traceback (most recent call last):
    File "d:\projects\TV-Series-Analysis-System\env1\Lib\site-packages\pydantic\type_adapter.py", line 271, in _init_core_attrs
    self.core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "d:\projects\TV-Series-Analysis-System\env1\Lib\site-packages\pydantic\type_adapter.py", line 55, in _getattr_no_parents
    raise AttributeError(attribute)
    AttributeError: __pydantic_core_schema__

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "d:\projects\TV-Series-Analysis-System\env1\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi
    result = await app( # type: ignore[func-returns-value]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "d:\projects\TV-Series-Analysis-System\env1\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "d:\projects\TV-Series-Analysis-System\env1\Lib\site-packages\pydantic\_internal\_generate_schema.py", line 513, in _unknown_type_schema
    raise PydanticSchemaGenerationError(
    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.

    If you got this error by calling handler(<some type>) within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema(<some type>)` since we do not call `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion.

    For further information visit https://errors.pydantic.dev/2.10/u/schema-for-unknown-type```


    I tried to upgrade pydantic and gradio but it did not work. Please help. I try it in google colab as well but am not getting any response. It runs indefinitely and does not provide any result.

    The gradio interface looks like this:

    [​IMG]

    Continue reading...

Compartilhe esta Página