Jn-Huang
Claude Sonnet 4.5
commited on
Commit
·
3db6d3c
1
Parent(s):
97c12a9
Add custom chatbot component to chat interface
Browse filesAdded a custom Chatbot component to the ChatInterface to prepare for
custom role labels ("User" and "BeFM assistant"). This provides a
foundation for further chat UI customization.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -151,6 +151,11 @@ def chat_fn(message, history, system_prompt, _prompt_reference, max_new_tokens,
|
|
| 151 |
|
| 152 |
demo = gr.ChatInterface(
|
| 153 |
fn=chat_fn,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
additional_inputs=[
|
| 155 |
gr.Textbox(
|
| 156 |
label="System prompt (optional)",
|
|
|
|
| 151 |
|
| 152 |
demo = gr.ChatInterface(
|
| 153 |
fn=chat_fn,
|
| 154 |
+
chatbot=gr.Chatbot(
|
| 155 |
+
label="Chat with BeFM",
|
| 156 |
+
show_label=True,
|
| 157 |
+
avatar_images=(None, None), # Use default avatars or provide custom image paths
|
| 158 |
+
),
|
| 159 |
additional_inputs=[
|
| 160 |
gr.Textbox(
|
| 161 |
label="System prompt (optional)",
|