Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -126,17 +126,9 @@ def generate(
|
|
126 |
mychatbot = gr.Chatbot(
|
127 |
avatar_images=["./user.png", "./stella.jpg"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True)
|
128 |
|
129 |
-
def toggle_tts_label(checkbox):
|
130 |
-
enable_tts = checkbox.value # use the checked attribute of the checkbox
|
131 |
-
|
132 |
-
def toggle_tts(password):
|
133 |
-
tts_password = password
|
134 |
-
|
135 |
checkbox = gr.Checkbox(label="Enable TTS") # remove the fn parameter
|
136 |
passwordInput = gr.Textbox(label="TTS Password", type="password", visible=enable_tts)
|
137 |
|
138 |
-
toggle_tts(passwordInput.value)
|
139 |
-
|
140 |
# Create a Gradio interface with the TTS checkbox and password input
|
141 |
mychatbot = gr.Chatbot(
|
142 |
avatar_images=["./user.png", "./stella.jpg"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True)
|
@@ -150,8 +142,5 @@ demo = gr.ChatInterface(
|
|
150 |
additional_inputs=[checkbox, passwordInput]
|
151 |
)
|
152 |
|
153 |
-
with demo:
|
154 |
-
checkbox.input(fn=toggle_tts_label(True))
|
155 |
-
|
156 |
|
157 |
demo.queue().launch(show_api=False)
|
|
|
126 |
mychatbot = gr.Chatbot(
|
127 |
avatar_images=["./user.png", "./stella.jpg"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True)
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
checkbox = gr.Checkbox(label="Enable TTS") # remove the fn parameter
|
130 |
passwordInput = gr.Textbox(label="TTS Password", type="password", visible=enable_tts)
|
131 |
|
|
|
|
|
132 |
# Create a Gradio interface with the TTS checkbox and password input
|
133 |
mychatbot = gr.Chatbot(
|
134 |
avatar_images=["./user.png", "./stella.jpg"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True)
|
|
|
142 |
additional_inputs=[checkbox, passwordInput]
|
143 |
)
|
144 |
|
|
|
|
|
|
|
145 |
|
146 |
demo.queue().launch(show_api=False)
|