Duplicated gradio app receives "Task exception was never retrieved"
I duplicated an app withhttps://huggingface.co/spaces/innev/ChatGLM-6B-INT4and also tried theminimal app from the tutorial:https://www.gradio.app/guides/creating-a-chatbotBoth of them do not require a GPU while a same error pops out, anyone knows what is happening?Task exception was never retrieved
future: <Task finished name='tsbawo0iq9m_1' coro=<Queue.process_events() done, defined at /home/user/.local/lib/python3.10/site-packages/gradio/queueing.py:343> exception=1 validation error for PredictBody
event_id
  Field required [type=missing, input_value={'fn_index': 1, 'data': [...on_hash': 'tsbawo0iq9m'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.1.2/v/missing>
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.10/site-packages/gradio/queueing.py", line 347, in process_events
    client_awake = await self.gather_event_data(event)
  File "/home/user/.local/lib/python3.10/site-packages/gradio/queueing.py", line 220, in gather_event_data
    data, client_awake = await self.get_message(event, timeout=receive_timeout)
  File "/home/user/.local/lib/python3.10/site-packages/gradio/queueing.py", line 456, in get_message
    return PredictBody(**data), True
  File "/home/user/.local/lib/python3.10/site-packages/pydantic/main.py", line 150, 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={'fn_index': 1, 'data': [...on_hash': 'tsbawo0iq9m'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.1.2/v/missing
Task exception was never retrieved
future: <Task finished name='24iy8opwivr_1' coro=<Queue.process_events() done, defined at /home/user/.local/lib/python3.10/site-packages/gradio/queueing.py:343> exception=1 validation error for PredictBody
event_id
  Field required [type=missing, input_value={'fn_index': 1, 'data': [...on_hash': '24iy8opwivr'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.1.2/v/missing>
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.10/site-packages/gradio/queueing.py", line 347, in process_events
    client_awake = await self.gather_event_data(event)
  File "/home/user/.local/lib/python3.10/site-packages/gradio/queueing.py", line 220, in gather_event_data
    data, client_awake = await self.get_message(event, timeout=receive_timeout)
  File "/home/user/.local/lib/python3.10/site-packages/gradio/queueing.py", line 456, in get_message
    return PredictBody(**data), True
  File "/home/user/.local/lib/python3.10/site-packages/pydantic/main.py", line 150, 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={'fn_index': 1, 'data': [...on_hash': '24iy8opwivr'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.1.2/v/missingTheapp.pyin the tutorial I used isimport gradio as gr
import random
import time

# Chatbot demo with multimodal input (text, markdown, LaTeX, code blocks, image, audio, & video). Plus shows support for streaming text.

def add_text(history, text):
    history = history + [(text, None)]
    return history, gr.update(value="", interactive=False)


def add_file(history, file):
    history = history + [((file.name,), None)]
    return history


def bot(history):
    response = "**That's cool!**"
    history[-1][1] = ""
    for character in response:
        history[-1][1] += character
        time.sleep(0.05)
        yield history


with gr.Blocks() as demo:
    chatbot = gr.Chatbot([], elem_id="chatbot").style(height=750)

    with gr.Row():
        with gr.Column(scale=0.85):
            txt = gr.Textbox(
                show_label=False,
                placeholder="Enter text and press enter, or upload an image",
            ).style(container=False)
        with gr.Column(scale=0.15, min_width=0):
            btn = gr.UploadButton("📁", file_types=["image", "video", "audio"])

    txt_msg = txt.submit(add_text, [chatbot, txt], [chatbot, txt], queue=False).then(
        bot, chatbot, chatbot
    )
    txt_msg.then(lambda: gr.update(interactive=True), None, [txt], queue=False)
    file_msg = btn.upload(add_file, [chatbot, btn], [chatbot], queue=False).then(
        bot, chatbot, chatbot
    )

demo.queue()
demo.launch()
2023-07-10T22:20:46Z
the same issue happened suddenly. Have you solved it?
2023-07-11T05:49:49Z
hi@jingwangand@umiuniMy guess is it could be due to Gradio version and Python version,You can set booth versions on the README.mdsdk_version: 3.36.1 
python_version: 3.9.17
2023-07-11T12:08:49Z
Same issue  here,  from local it works
2023-07-11T12:13:03Z
It solves the problem. Thank you so much!
2023-07-11T12:43:34Z
thsnks it works
2023-07-11T19:47:59Z
Hi there,I’m sorry to hear you’re having trouble. It seems like you might be experiencing a known issue related to older Gradio versions (<3.36.1) on Spaces. This is caused by a breaking change in Pydantic 2.0 that was recently adopted by FastAPI, causing Spaces to potentially crash upon restart.The good news is we have a solution. We request you to upgrade Gradio to 3.36.1 across all your Spaces (the gradio sdk in a Space’s readme.md file), which should eliminate this issue. For local usage, you’ll only need to upgrade Gradio if you’ve updated to the latest FastAPI/Pydantic versions.I strongly recommend updating to Gradio 3.36.1 to avoid future problems. We have issued an announcement on our Discord to remind users about this important update. You can find it here -DiscordI hope this helps!