jshilong / GPT4RoI

GPT4RoI: Instruction Tuning Large Language Model on Region-of-Interest
Other
506 stars 25 forks source link

Demo error when attempting to send message: PredictBody validation error, missing required field #42

Open mattmazzola opened 10 months ago

mattmazzola commented 10 months ago

In the video of #41 I demonstrate an error when running the demo.

It seems to be missing required property in one of the events sent through gradio Given the error occurs inside gradio-dev runtime I am unsure if is due to the app.py sending the wrong data, or if there is some issue inside the actual gradio-dev package

Running on local URL:  http://0.0.0.0:20012

To create a public link, set `share=True` in `launch()`.
Task exception was never retrieved
future: <Task finished name='6976h8jtnyr_7' coro=<Queue.process_events() done, defined at /workspaces/GPT4RoI/gradio-dev/gradio/queueing.py:342> exception=1 validation error for PredictBody
event_id
  Field required [type=missing, input_value={'data': [], 'event_data'...on_hash': '6976h8jtnyr'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/missing>
Traceback (most recent call last):
  File "/workspaces/GPT4RoI/gradio-dev/gradio/queueing.py", line 346, in process_events
    client_awake = await self.gather_event_data(event)
  File "/workspaces/GPT4RoI/gradio-dev/gradio/queueing.py", line 219, in gather_event_data
    data, client_awake = await self.get_message(event, timeout=receive_timeout)
  File "/workspaces/GPT4RoI/gradio-dev/gradio/queueing.py", line 448, in get_message
    return PredictBody(**data), True
  File "/home/vscode/miniconda3/envs/gpt4roi/lib/python3.9/site-packages/pydantic/main.py", line 164, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for PredictBody
event_id
  Field required [type=missing, input_value={'data': [], 'event_data'...on_hash': '6976h8jtnyr'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/missing
kooWZ commented 2 months ago

Downgrading pydantic to 1.9.1 fixes this