You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何移除或编辑Gradio ChatInterface左上角的"Chatbot"标题?

解决Gradio ChatInterface左上角"Chatbot"标题的移除/编辑问题

有两种可行的方法来实现需求:

方法一:通过自定义CSS修改

直接在现有CSS中添加针对标题的样式规则,可选择隐藏或替换文本:

  • 隐藏标题:
    在css参数中补充以下代码:
    footer {visibility: hidden}
    #chatbot .gr-panel-title {visibility: hidden;}
    
  • 替换为自定义标题:
    使用CSS伪元素覆盖原有文本:
    footer {visibility: hidden}
    #chatbot .gr-panel-title {
        visibility: hidden;
        position: relative;
    }
    #chatbot .gr-panel-title::after {
        content: "你的自定义标题";
        visibility: visible;
        position: absolute;
        left: 0;
        top: 0;
    }
    

方法二:自定义Chatbot组件

通过chatbot参数传入自定义的Chatbot组件,直接设置标题内容:

# 创建自定义Chatbot,label设为空则隐藏标题,设为文本则替换
custom_chatbot = gr.Chatbot(label="你的自定义标题")  # 或label=""

aleph_ui = gr.ChatInterface(
    chat_streamer, 
    submit_btn=None, 
    stop_btn=None, 
    retry_btn=None, 
    undo_btn=None, 
    clear_btn=None, 
    css="footer {visibility: hidden}",
    theme=gradio_theme,
    chatbot=custom_chatbot
).queue()

内容的提问来源于stack exchange,提问作者Hualdo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 13:51:01