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

Add chat bubble width param #5334

Merged
merged 8 commits into from Aug 29, 2023
Merged

Add chat bubble width param #5334

merged 8 commits into from Aug 29, 2023

Conversation

dawoodkhan82
Copy link
Collaborator

Description

Adds the highly requested param to change the chatbot message bubble width to fit message content.

Screenshot 2023-08-24 at 3 37 09 PM

Closes: #4420

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Aug 24, 2023

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
Visual tests all good! Build review
🦄 Changes detected! Details
📓 Notebooks matching!

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/244b684e3de9206bae1623495022c9b0dbcf2e2f/gradio-3.41.2-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@244b684e3de9206bae1623495022c9b0dbcf2e2f#subdirectory=client/python"

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Aug 24, 2023

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/chatbot minor
gradio minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Add chat bubble width param

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@abidlabs
Copy link
Member

LGTM @dawoodkhan82! Could we add a story for this as well?

@dawoodkhan82 dawoodkhan82 merged commit c5bf913 into main Aug 29, 2023
18 checks passed
@dawoodkhan82 dawoodkhan82 deleted the chat-width branch August 29, 2023 00:48
@pngwn pngwn mentioned this pull request Aug 29, 2023
@austinmw
Copy link

austinmw commented Sep 8, 2023

Does this work for gr.ChatInterface?

@dawoodkhan82
Copy link
Collaborator Author

dawoodkhan82 commented Sep 11, 2023

Does this work for gr.ChatInterface?

@abidlabs Should we add chat_bubble_width as a param on gr.ChatInterface? Or maybe make it full_width be default.

@abidlabs
Copy link
Member

Not necessary, you can pass in a custom Chatbot instance as the chatbot parameter to gr.ChatInterface to get this behavior.

See this Space by @yvrjsharma for example: https://huggingface.co/spaces/ysharma/falcon-180b-demo/blob/92739960e894d417f240b2ec6f55e92ab6b0c788/app.py#L124

@lucasjinreal
Copy link

@abidlabs thanks for this useful feature.

Is the possible add further a max_width here when full_width is false?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chatbot: limit width of chat bubbles to be the size of the messages
5 participants