Gradio 三种界面布局 Interface 一键工厂 · ChatInterface 聊天壳子 · Blocks 乐高积木
gr.Interface 一键 Demo 工厂 · 单输入→单输出 inputs:name (Textbox) fn = greet outputs:result (Textbox) examples 一点填入 Submit ✓ inputs/outputs 可用简写 "text" title · description · theme 负责包装 最简:fn + inputs + outputs gr.ChatInterface 接大模型的聊天壳子 · 多轮对话 Chatbot Textbox 输入… 发送 ★ 自动维护多轮 history 你不用手动管理对话列表 chatbot / textbox 可自定义外观 gr.Blocks 搭复杂界面的乐高 · 自由排版 gr.Row() gr.Column 上传图片 gr.Column 检测结果 开始检测 button.click( fn, inputs, outputs ) 显式绑定按钮事件 ⚠ Blocks 里 inputs/outputs 必须是组件对象,不能用简写