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 gr.TextBox customization stopped working in gr.ChatInterface #7781

Closed
1 task done
Rivridis opened this issue Mar 21, 2024 · 2 comments · Fixed by #7783
Closed
1 task done

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

Rivridis opened this issue Mar 21, 2024 · 2 comments · Fixed by #7783
Assignees
Labels
bug Something isn't working

Comments

@Rivridis
Copy link

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? 🔎

  • I have searched and found no 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

@Rivridis Rivridis added the bug Something isn't working label Mar 21, 2024
@freddyaboulton
Copy link
Collaborator

Simple mistake @Rivridis - will have a fix soon

@Rivridis
Copy link
Author

Ah Thanks

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
2 participants