Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -285,7 +285,15 @@ def transcribe_speech(filepath):
|
|
285 |
|
286 |
demo = gr.Blocks(css=CSS,js=js, theme='NoCrypt/miku')
|
287 |
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
with demo:
|
|
|
|
|
289 |
chat_demo_interface = gr.ChatInterface(
|
290 |
fn=chat,
|
291 |
description="""**Vintern-3B-R-beta** is the latest in the Vintern series.""",
|
@@ -302,7 +310,13 @@ with demo:
|
|
302 |
# additional_inputs=[gr.Checkbox(label="Think", value=False)],
|
303 |
theme='NoCrypt/miku'
|
304 |
)
|
305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
# mic_transcribe = gr.Interface(
|
307 |
# fn=transcribe_speech,
|
308 |
# inputs=gr.Audio(sources="microphone", type="filepath", editable=False),
|
|
|
285 |
|
286 |
demo = gr.Blocks(css=CSS,js=js, theme='NoCrypt/miku')
|
287 |
|
288 |
+
# Hàm bật/tắt Think Mode
|
289 |
+
def toggle_think_mode(current_state):
|
290 |
+
return not current_state
|
291 |
+
|
292 |
+
|
293 |
+
|
294 |
with demo:
|
295 |
+
think_mode = gr.State(False) # Lưu trạng thái Think Mode
|
296 |
+
|
297 |
chat_demo_interface = gr.ChatInterface(
|
298 |
fn=chat,
|
299 |
description="""**Vintern-3B-R-beta** is the latest in the Vintern series.""",
|
|
|
310 |
# additional_inputs=[gr.Checkbox(label="Think", value=False)],
|
311 |
theme='NoCrypt/miku'
|
312 |
)
|
313 |
+
|
314 |
+
with gr.Row():
|
315 |
+
think_button = gr.Button("🧠 Think Mode", variant="secondary") # Nút bật/tắt
|
316 |
+
|
317 |
+
# Khi nhấn nút, trạng thái think_mode thay đổi
|
318 |
+
think_button.click(toggle_think_mode, inputs=[think_mode], outputs=[think_mode])
|
319 |
+
|
320 |
# mic_transcribe = gr.Interface(
|
321 |
# fn=transcribe_speech,
|
322 |
# inputs=gr.Audio(sources="microphone", type="filepath", editable=False),
|