Spaces:
Sleeping
Sleeping
Mahdi Naser Moghadasi commited on
Commit ·
081d73d
1
Parent(s): 5725970
🔧 Fix voice button display - add voice_button_display component and connect to event handlers
Browse files
app.py
CHANGED
|
@@ -1561,6 +1561,12 @@ with gr.Blocks(
|
|
| 1561 |
label="Albert is typing..."
|
| 1562 |
)
|
| 1563 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1564 |
# Albert's personality info
|
| 1565 |
gr.Markdown("""
|
| 1566 |
### 🧠 About Albert
|
|
@@ -1699,19 +1705,19 @@ with gr.Blocks(
|
|
| 1699 |
send_btn.click(
|
| 1700 |
fn=send_message,
|
| 1701 |
inputs=[chat_input, user_name, user_age_group, chat_display, voice_enabled],
|
| 1702 |
-
outputs=[chat_display, chat_input,
|
| 1703 |
)
|
| 1704 |
|
| 1705 |
clear_btn.click(
|
| 1706 |
fn=clear_chat,
|
| 1707 |
-
outputs=[chat_display,
|
| 1708 |
)
|
| 1709 |
|
| 1710 |
# Initialize chat when name is entered
|
| 1711 |
user_name.change(
|
| 1712 |
fn=initialize_chat,
|
| 1713 |
inputs=[user_name, user_age_group],
|
| 1714 |
-
outputs=[chat_display,
|
| 1715 |
)
|
| 1716 |
|
| 1717 |
with gr.TabItem("🔧 Admin Dashboard", visible=False): # Hidden by default
|
|
|
|
| 1561 |
label="Albert is typing..."
|
| 1562 |
)
|
| 1563 |
|
| 1564 |
+
# Voice button display
|
| 1565 |
+
voice_button_display = gr.HTML(
|
| 1566 |
+
value="",
|
| 1567 |
+
label="Voice Controls"
|
| 1568 |
+
)
|
| 1569 |
+
|
| 1570 |
# Albert's personality info
|
| 1571 |
gr.Markdown("""
|
| 1572 |
### 🧠 About Albert
|
|
|
|
| 1705 |
send_btn.click(
|
| 1706 |
fn=send_message,
|
| 1707 |
inputs=[chat_input, user_name, user_age_group, chat_display, voice_enabled],
|
| 1708 |
+
outputs=[chat_display, chat_input, voice_button_display]
|
| 1709 |
)
|
| 1710 |
|
| 1711 |
clear_btn.click(
|
| 1712 |
fn=clear_chat,
|
| 1713 |
+
outputs=[chat_display, voice_button_display, voice_button_display]
|
| 1714 |
)
|
| 1715 |
|
| 1716 |
# Initialize chat when name is entered
|
| 1717 |
user_name.change(
|
| 1718 |
fn=initialize_chat,
|
| 1719 |
inputs=[user_name, user_age_group],
|
| 1720 |
+
outputs=[chat_display, voice_button_display, voice_button_display]
|
| 1721 |
)
|
| 1722 |
|
| 1723 |
with gr.TabItem("🔧 Admin Dashboard", visible=False): # Hidden by default
|