Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -296,15 +296,17 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 296 |
mic = gr.Audio(type="filepath", label="🎤 Record Voice (hold & speak)", show_download_button=True)
|
| 297 |
audio_output = gr.Audio(label="Assistant Voice Output", type="filepath", interactive=False)
|
| 298 |
tts_lang = gr.Dropdown(choices=["en", "ur"], value="en", label="TTS Language")
|
| 299 |
-
|
| 300 |
-
btn_download_logs = gr.Button("📥 Download Summary")
|
| 301 |
with gr.Row():
|
| 302 |
btn_general = gr.Button("⚡Ask General 🎯")
|
| 303 |
btn_pdf = gr.Button("⚡Ask PDF 📄")
|
| 304 |
btn_image = gr.Button("⚡Ask Image 🖼")
|
| 305 |
enhancer_toggle = gr.Checkbox(label="Enable Response Enhancer", value=False, scale =1)
|
| 306 |
tone_dropdown = gr.Dropdown(choices=["Helpful", "Formal", "Friendly"], value="Helpful", label="Enhancer Tone", scale =1)
|
| 307 |
-
|
|
|
|
|
|
|
|
|
|
| 308 |
#btn_general = gr.Button("⚡Ask General 🎯")
|
| 309 |
#btn_pdf = gr.Button("⚡Ask PDF 📄")
|
| 310 |
#btn_image = gr.Button("⚡Ask Image 🖼")
|
|
@@ -321,7 +323,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 321 |
btn_image.click(fn=handle_voice_image, inputs=[mic, session_image, tts_lang], outputs=[answer_voice, audio_output, chat_voice])
|
| 322 |
# btn_send_text.click(fn=handle_text_general, inputs=[text_input, session_voice, enhancer_toggle, tone_dropdown], outputs=[answer_voice, chat_voice])
|
| 323 |
btn_reset_logs.click(lambda: (str(uuid.uuid4()), [], None, None, ""), outputs=[session_voice, chat_voice, mic, audio_output, answer_voice])
|
| 324 |
-
btn_download_logs.click(download_pdf_summary, inputs=[session_voice], outputs=[
|
| 325 |
|
| 326 |
with gr.Tab("📄 PDF Summarizer"):
|
| 327 |
pdf_output = gr.Textbox(label="Answer (Text Only)", lines=5)
|
|
|
|
| 296 |
mic = gr.Audio(type="filepath", label="🎤 Record Voice (hold & speak)", show_download_button=True)
|
| 297 |
audio_output = gr.Audio(label="Assistant Voice Output", type="filepath", interactive=False)
|
| 298 |
tts_lang = gr.Dropdown(choices=["en", "ur"], value="en", label="TTS Language")
|
| 299 |
+
|
|
|
|
| 300 |
with gr.Row():
|
| 301 |
btn_general = gr.Button("⚡Ask General 🎯")
|
| 302 |
btn_pdf = gr.Button("⚡Ask PDF 📄")
|
| 303 |
btn_image = gr.Button("⚡Ask Image 🖼")
|
| 304 |
enhancer_toggle = gr.Checkbox(label="Enable Response Enhancer", value=False, scale =1)
|
| 305 |
tone_dropdown = gr.Dropdown(choices=["Helpful", "Formal", "Friendly"], value="Helpful", label="Enhancer Tone", scale =1)
|
| 306 |
+
with gr.Row():
|
| 307 |
+
btn_reset_logs = gr.Button("♻ Reset LOGs")
|
| 308 |
+
btn_download_logs = gr.Button("📥 Download Summary")
|
| 309 |
+
Voice_summary_file = gr.File(label="📥Download Summary File", interactive=False)
|
| 310 |
#btn_general = gr.Button("⚡Ask General 🎯")
|
| 311 |
#btn_pdf = gr.Button("⚡Ask PDF 📄")
|
| 312 |
#btn_image = gr.Button("⚡Ask Image 🖼")
|
|
|
|
| 323 |
btn_image.click(fn=handle_voice_image, inputs=[mic, session_image, tts_lang], outputs=[answer_voice, audio_output, chat_voice])
|
| 324 |
# btn_send_text.click(fn=handle_text_general, inputs=[text_input, session_voice, enhancer_toggle, tone_dropdown], outputs=[answer_voice, chat_voice])
|
| 325 |
btn_reset_logs.click(lambda: (str(uuid.uuid4()), [], None, None, ""), outputs=[session_voice, chat_voice, mic, audio_output, answer_voice])
|
| 326 |
+
btn_download_logs.click(download_pdf_summary, inputs=[session_voice], outputs=[Voice_summary_file])
|
| 327 |
|
| 328 |
with gr.Tab("📄 PDF Summarizer"):
|
| 329 |
pdf_output = gr.Textbox(label="Answer (Text Only)", lines=5)
|