Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ def respond(
|
|
36 |
yield response
|
37 |
|
38 |
|
39 |
-
# Custom HTML for mic button and
|
40 |
mic_html = """
|
41 |
<div class="mic-container">
|
42 |
<button id="mic_button" title="Click to speak">
|
@@ -133,22 +133,24 @@ if ('webkitSpeechRecognition' in window) {
|
|
133 |
"""
|
134 |
|
135 |
# Gradio Chat Interface with Mic Button
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
minimum=0.1,
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
)
|
151 |
-
|
|
|
152 |
|
153 |
if __name__ == "__main__":
|
154 |
demo.launch()
|
|
|
|
36 |
yield response
|
37 |
|
38 |
|
39 |
+
# Custom HTML and JS for mic button and speech-to-text
|
40 |
mic_html = """
|
41 |
<div class="mic-container">
|
42 |
<button id="mic_button" title="Click to speak">
|
|
|
133 |
"""
|
134 |
|
135 |
# Gradio Chat Interface with Mic Button
|
136 |
+
with gr.Blocks() as demo:
|
137 |
+
gr.HTML(mic_html)
|
138 |
+
chatbot = gr.ChatInterface(
|
139 |
+
fn=respond,
|
140 |
+
additional_inputs=[
|
141 |
+
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
142 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
143 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
144 |
+
gr.Slider(
|
145 |
+
minimum=0.1,
|
146 |
+
maximum=1.0,
|
147 |
+
value=0.95,
|
148 |
+
step=0.05,
|
149 |
+
label="Top-p (nucleus sampling)",
|
150 |
+
),
|
151 |
+
],
|
152 |
+
)
|
153 |
|
154 |
if __name__ == "__main__":
|
155 |
demo.launch()
|
156 |
+
|