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

Gradio reload mode does not work with Chatbot based app #8576

Closed
1 task done
johannesgiorgis-galvanize opened this issue Jun 18, 2024 · 2 comments · Fixed by #8599
Closed
1 task done

Gradio reload mode does not work with Chatbot based app #8576

johannesgiorgis-galvanize opened this issue Jun 18, 2024 · 2 comments · Fixed by #8599
Assignees
Labels
bug Something isn't working

Comments

@johannesgiorgis-galvanize
Copy link

johannesgiorgis-galvanize commented Jun 18, 2024

Describe the bug

For local development, we run our Gradio apps via gradio app.py --demo-name main_demo command to take advantage of automatic reloads to speed up our development feedback. This was working well a few months ago when we were using Gradio v4.25.0

Using v4.36.1, I observed an error related to the watch function when I try to load chatbot based apps. The error is coming from

if dependency.cancels:
. Refer to the included screenshot.

I did look around the issues list and don't see any mentions of this.

λ  pip list | grep gradio
gradio                    4.36.1
gradio_client             1.0.1

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

Right now this happens for any Chatbot based app. Below is a minimal working snippet

import gradio as gr

def stream_response(input: str, history: list):
    pass # some code

interface = gr.ChatInterface(
    stream_response,
    title="FAQ Chatbot",
    description="Welcome to our FAQ chatbot.",
    chatbot=gr.Chatbot(height=600),
    fill_height=True,
)

with gr.Blocks(
) as demo:
    with gr.Tabs():
        with gr.TabItem("FAQ Chatbot"):
            interface.render()

Run Gradio via gradio app.py --demo-name demo

Screenshot

image

Logs

Refer to screenshot for logs

System Info

Macbook Pro M1 Pro


λ  gradio environment
Gradio Environment Information:
------------------------------
Operating System: Darwin
gradio version: 4.36.1
gradio_client version: 1.0.1

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.3.0
fastapi: 0.111.0
ffmpy: 0.3.2
gradio-client==1.0.1 is not installed.
httpx: 0.24.1
huggingface-hub: 0.23.3
importlib-resources: 6.4.0
jinja2: 3.1.4
markupsafe: 2.1.5
matplotlib: 3.9.0
numpy: 1.26.4
orjson: 3.10.5
packaging: 23.2
pandas: 2.2.2
pillow: 10.3.0
pydantic: 2.7.4
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.4.8
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.12.2
urllib3: 2.2.1
uvicorn: 0.30.1
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.6.0
httpx: 0.24.1
huggingface-hub: 0.23.3
packaging: 23.2
typing-extensions: 4.12.2
websockets: 11.0.3

Severity

I can work around it

@johannesgiorgis-galvanize johannesgiorgis-galvanize added the bug Something isn't working label Jun 18, 2024
@abidlabs abidlabs changed the title Gradio Reload nto Gradio reload mode does not work with Chatbot based app Jun 19, 2024
@freddyaboulton
Copy link
Collaborator

Will look into this @johannesgiorgis-galvanize

@freddyaboulton freddyaboulton self-assigned this Jun 22, 2024
@freddyaboulton
Copy link
Collaborator

I can't reproduce the exact error message on main. Instead, the chatbot won't display messages after the reload. Looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants