mgokg commited on
Commit
4def658
·
verified ·
1 Parent(s): 7e33221

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -27,6 +27,7 @@ def audio_to_audio_chatbot(audio):
27
  #return speech["audio"], response_text
28
 
29
  if __name__ == "__main__":
 
30
  iface = gr.Interface(
31
  fn=audio_to_audio_chatbot,
32
  inputs=gr.Audio(type="filepath"),
@@ -36,6 +37,14 @@ if __name__ == "__main__":
36
  description="Spreche in das Mikrofon und der Bot antwortet mit einer Audio-Ausgabe.",
37
  live=True # Aktiviert Streaming
38
  )
39
-
40
- iface.launch()
 
 
 
 
 
 
 
 
41
 
 
27
  #return speech["audio"], response_text
28
 
29
  if __name__ == "__main__":
30
+ """
31
  iface = gr.Interface(
32
  fn=audio_to_audio_chatbot,
33
  inputs=gr.Audio(type="filepath"),
 
37
  description="Spreche in das Mikrofon und der Bot antwortet mit einer Audio-Ausgabe.",
38
  live=True # Aktiviert Streaming
39
  )
40
+ """
41
+ with gr.Blocks() as speech:
42
+
43
+ with gr.Row():
44
+ sr_outputs = gr.Textbox(label="Antwort")
45
+ with gr.Row():
46
+ sr_inputs = gr.Microphone(type="filepath")
47
+ sr_inputs.change(transcribe_audio, inputs=sr_inputs, outputs=sr_outputs)
48
+
49
+ speech.launch(fn=audio_to_audio_chatbot)
50