gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
30.56k stars 2.27k forks source link

TabbedInterface does not work properly #8438

Closed luaperl closed 3 weeks ago

luaperl commented 3 weeks ago

Describe the bug

The demo example (tabbed_interface_lite) in the official TabbedInterface documentation does not work properly.

The first tab (Hello World) prints "Hello name" as the code says, but the second tab (Bye World) does not print anything.

I tried running the code directly in a local environment, but the phenomenon was the same. If it was my mistake, please let me know what I did wrong.

Have you searched existing issues? 🔎

Reproduction

import gradio as gr

hello_world = gr.Interface(lambda name: "Hello " + name, "text", "text")
bye_world = gr.Interface(lambda name: "Bye " + name, "text", "text")

demo = gr.TabbedInterface([hello_world, bye_world], ["Hello World", "Bye World"])

if __name__ == "__main__":
    demo.launch()

Screenshot

1 2

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 4.32.2
gradio_client version: 0.17.0

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

aiofiles: 23.2.1
altair: 5.3.0
fastapi: 0.111.0
ffmpy: 0.3.2
gradio-client==0.17.0 is not installed.
httpx: 0.27.0
huggingface-hub: 0.23.2
importlib-resources: 6.4.0
jinja2: 3.1.4
markupsafe: 2.1.5
matplotlib: 3.9.0
numpy: 1.26.4
orjson: 3.10.3
packaging: 23.1
pandas: 2.2.2
pillow: 10.3.0
pydantic: 2.7.1
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.4.7
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.11.0
urllib3: 2.1.0
uvicorn: 0.30.1
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2024.5.0
httpx: 0.27.0
huggingface-hub: 0.23.2
packaging: 23.1
typing-extensions: 4.11.0
websockets: 11.0.3

Severity

I can work around it

abidlabs commented 3 weeks ago

Thanks @luaperl I can indeed repro the issue, but it looks like a duplicate of https://github.com/gradio-app/gradio/issues/8425, so let me go ahead and close this one