-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Adds additional_inputs
to gr.ChatInterface
#4985
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-4985-all-demos You can install the changes in this PR by running: pip install https://gradio-builds.s3.amazonaws.com/4b0e98e40ac94b8c43ba2158d02ec0ce27366881/gradio-3.38.0-py3-none-any.whl |
🎉 Chromatic build completed! There are 0 visual changes to review. |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
🎉 The demo notebooks match the run.py files! 🎉 |
additional_inputs
to gr.ChatInterface
additional_inputs
to gr.ChatInterface
gradio/chat_interface.py
Outdated
outputs=self.chatbot, | ||
fn=examples_fn, | ||
cache_examples=self.cache_examples, | ||
# cache_examples=cache_examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna delete this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -130,9 +142,10 @@ def __init__( | |||
self.textbox = Textbox( | |||
container=False, | |||
show_label=False, | |||
label="Message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we adding a label here if show_label
is false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the label is used as the header of the table when examples are provided with additional inputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me @abidlabs ! Thanks for the tests and feature. Will merge by the end of the weekend unless there are other comments.
Appreciate the review @freddyaboulton! I’d keep the label but remove the comment, thanks |
This reverts commit 1004285.
Adds
additional_inputs
togr.ChatInterface
.Basic usage example:
which produces this:
The nice thing is that you don't have to render the
additional_inputs
in this way. By putting thegr.ChatInterface
in agr.Blocks
, you can have theadditional_inputs
show up wherever you want. For example, to have the system prompt show up on the top:I've added tests and updated the documentation. I'll be OOO so feel free to push directly to this branch if needed or merge it in.