Update app.py
Browse files
app.py
CHANGED
@@ -135,20 +135,4 @@ def handle_query(audio_or_text: str):
|
|
135 |
# --- Gradio UI ---
|
136 |
with gr.Blocks() as demo:
|
137 |
gr.Markdown("## Shop Voice-Box Assistant (Speech In/Out)")
|
138 |
-
inp = gr.Audio(
|
139 |
-
out_text = gr.Textbox(label="Answer (text)")
|
140 |
-
out_audio = gr.Audio(label="Answer (speech)")
|
141 |
-
submit = gr.Button("Submit")
|
142 |
-
gr.Examples(
|
143 |
-
examples=[
|
144 |
-
["What is the max revenue product today?"],
|
145 |
-
["Who invented the light bulb?"],
|
146 |
-
["Tell me a joke about cats."],
|
147 |
-
],
|
148 |
-
inputs=inp,
|
149 |
-
outputs=[out_text, out_audio],
|
150 |
-
)
|
151 |
-
submit.click(fn=handle_query, inputs=inp, outputs=[out_text, out_audio])
|
152 |
-
|
153 |
-
if __name__ == "__main__":
|
154 |
-
demo.launch(share=False, server_name="0.0.0.0", server_port=7860)
|
|
|
135 |
# --- Gradio UI ---
|
136 |
with gr.Blocks() as demo:
|
137 |
gr.Markdown("## Shop Voice-Box Assistant (Speech In/Out)")
|
138 |
+
inp = gr.Audio(sources=["microphone"], type="filepath", label="Speak or type your question")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|