Update app.py
Browse files
app.py
CHANGED
@@ -82,9 +82,9 @@ async def respond(audio):
|
|
82 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
83 |
tmp_path = tmp_file.name
|
84 |
await communicate.save(tmp_path)
|
85 |
-
return tmp_path
|
86 |
except Exception as e:
|
87 |
-
return str(e)
|
88 |
|
89 |
additional_inputs = [
|
90 |
gr.Slider(
|
@@ -133,13 +133,14 @@ customCSS = """
|
|
133 |
"""
|
134 |
|
135 |
with gr.Blocks(css=customCSS) as demo:
|
136 |
-
gr.Markdown("#
|
137 |
-
gr.Markdown("Getting real-time updated results for prompts is still proprietary in the face of GPT-4, Co-Pilot etc. This app serves as an open-source alternative for this! UPDATE: Previous version of this app i.e.
|
138 |
|
139 |
with gr.Row():
|
140 |
-
input_audio = gr.Audio(label="Voice Chat (BETA)",
|
|
|
141 |
output_audio = gr.Audio(label="JARVIS", type="filepath", interactive=False, autoplay=True, elem_classes="audio")
|
142 |
-
gr.Interface(fn=respond, inputs=[input_audio], outputs=[output_audio], live=True)
|
143 |
|
144 |
gr.Markdown("## Additional Parameters")
|
145 |
for slider in additional_inputs:
|
|
|
82 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
83 |
tmp_path = tmp_file.name
|
84 |
await communicate.save(tmp_path)
|
85 |
+
return response_text, tmp_path
|
86 |
except Exception as e:
|
87 |
+
return str(e), None
|
88 |
|
89 |
additional_inputs = [
|
90 |
gr.Slider(
|
|
|
133 |
"""
|
134 |
|
135 |
with gr.Blocks(css=customCSS) as demo:
|
136 |
+
gr.Markdown("# RAG_FRIDAY_4.0🤖 WELCOME TO OPEN-SOURCE FREEDOM🤗(like never before)")
|
137 |
+
gr.Markdown("Getting real-time updated results for prompts is still proprietary in the face of GPT-4, Co-Pilot etc. This app serves as an open-source alternative for this! UPDATE: Previous version of this app i.e. RAG_FRIDAY_mark_3 is also available, this is just a upgrade providing voice-based search comfort for users")
|
138 |
|
139 |
with gr.Row():
|
140 |
+
input_audio = gr.Audio(label="Voice Chat (BETA)", source="microphone", type="filepath", waveform_options=False)
|
141 |
+
output_text = gr.Textbox(label="Text Response")
|
142 |
output_audio = gr.Audio(label="JARVIS", type="filepath", interactive=False, autoplay=True, elem_classes="audio")
|
143 |
+
gr.Interface(fn=respond, inputs=[input_audio], outputs=[output_text, output_audio], live=True)
|
144 |
|
145 |
gr.Markdown("## Additional Parameters")
|
146 |
for slider in additional_inputs:
|