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
33.43k stars 2.53k forks source link

Gradio gr.TextBox customization stopped working in gr.ChatInterface #7781

Closed Rivridis closed 7 months ago

Rivridis commented 7 months ago

Describe the bug

The way to customize the textbox in gr.ChatInterface has stopped working since the new update. The error I get is

Traceback (most recent call last):
  File "Test", line 268, in <module>
    c1 = gr.ChatInterface(chat,
         ^^^^^^^^^^^^^^^^^^^^^^
  File "Test\venv\Lib\site-packages\gradio\chat_interface.py", line 212, in __init__
    raise TypeError(
TypeError: Expected a gr.Textbox or gr.MultimodalTextbox component, but got <class 'gradio.components.textbox.Textbox'>

Have you searched existing issues? ๐Ÿ”Ž

Reproduction

import gradio as gr
def chat():
    return "Hello"
c1 = gr.ChatInterface(chat,
    chatbot=gr.Chatbot(height=400),
    textbox=gr.Textbox(placeholder="Type Message", container=False, scale=7),
    title="Test",
    examples=["Good Morning!", "Google en passant", "what is 899*99/21"],
    clear_btn="Clear",)
demo = gr.TabbedInterface([c1], ["Test"],theme=gr.themes.Soft())
demo.launch()

Screenshot

No response

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Windows
gradio version: 4.22.0
gradio_client version: 0.13.0

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

aiofiles: 23.2.1
altair: 5.2.0
fastapi: 0.109.2
ffmpy: 0.3.1
gradio-client==0.13.0 is not installed.
httpx: 0.26.0
huggingface-hub: 0.20.2
importlib-resources: 6.1.1
jinja2: 3.1.3
markupsafe: 2.1.3
matplotlib: 3.8.2
numpy: 1.26.2
orjson: 3.9.10
packaging: 23.2
pandas: 2.1.4
pillow: 10.2.0
pydantic: 2.5.3
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.2.2
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.9.0
typing-extensions: 4.9.0
uvicorn: 0.25.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2023.12.2
httpx: 0.26.0
huggingface-hub: 0.20.2
packaging: 23.2
typing-extensions: 4.9.0
websockets: 11.0.3

Severity

I can work around it

freddyaboulton commented 7 months ago

Simple mistake @Rivridis - will have a fix soon

Rivridis commented 7 months ago

Ah Thanks