Add Gradio demo with streaming chat and image upload#10
Open
korbonits wants to merge 2 commits intoTencent-Hunyuan:masterfrom
Open
Add Gradio demo with streaming chat and image upload#10korbonits wants to merge 2 commits intoTencent-Hunyuan:masterfrom
korbonits wants to merge 2 commits intoTencent-Hunyuan:masterfrom
Conversation
Author
Author
- app.py: interactive multimodal chat interface (Gradio >= 4.44) - gr.ChatInterface with MultimodalTextbox for image + text input - streaming output via TextIteratorStreamer in a background thread - sidebar controls: temperature, max new tokens, thinking mode toggle - lazy model loading on first request (thread-safe) - --share / --host / --port CLI flags; MODEL_PATH env var for local weights - example prompts for spatial reasoning and robot planning queries - README.md: adds Gradio Quick Start section; ticks roadmap item Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Gradio 6 introduced three breaking changes from 4.x: - gr.Blocks(theme=...) removed; theme now passed to launch() - gr.Chatbot(type="messages") removed (messages format is now default) - gr.Chatbot(show_copy_button=True) replaced by buttons=["copy"] - gr.ChatInterface(type="messages") kwarg removed app.py now detects the installed major version at import time (_GRADIO_MAJOR) and branches accordingly, keeping compatibility with both Gradio 4.x and 6.x. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
app.py: interactive multimodal chat demo usinggr.ChatInterfacewithgr.MultimodalTextbox(Gradio ≥ 4.44). Streaming output viaTextIteratorStreamerin a daemon thread. Sidebar controls for temperature, max new tokens, and thinking mode. Lazy model loading on first request (thread-safe lock). CLI flags for--share,--host,--port;MODEL_PATHenv var for local weights.README.md: new Gradio Quick Start section with install and run instructions; ticks the[ ] Online Gradio Demoroadmap item.Features
gr.MultimodalTextboxTextIteratorStreamer; no waiting for full responseenable_thinkinginapply_chat_templateMODEL_PATH=/path/to/dir python app.pypython app.py --sharefor a temporary Gradio tunnel URLUsage
Test plan
python app.pystarts without error and loads the model on first messagepython app.py --shareprints a public Gradio URLMODEL_PATH=/local/path python app.pyloads local weights🤖 Generated with Claude Code