Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -82,7 +82,7 @@ def generate_response(audio):
|
|
82 |
# response = client.chat_completion(messages, max_tokens=64, seed=random.randint(1, 5000), model="mistralai/Mistral-7B-Instruct-v0.3")
|
83 |
# response = response.choices[0].message.content.replace("Magic 8 Ball", "")
|
84 |
# return response, None, None
|
85 |
-
return "
|
86 |
|
87 |
@spaces.GPU
|
88 |
def read_response(answer):
|
@@ -134,4 +134,4 @@ with gr.Blocks() as block:
|
|
134 |
gr.HTML("""<h3 style='text-align: center;'> Examples: 'What is the meaning of life?', 'Should I get a dog?' </h3>""")
|
135 |
audio_in.stop_recording(generate_response, audio_in, [state, answer, audio_out]).then(fn=read_response, inputs=state, outputs=[answer, audio_out])
|
136 |
|
137 |
-
block.launch()
|
|
|
82 |
# response = client.chat_completion(messages, max_tokens=64, seed=random.randint(1, 5000), model="mistralai/Mistral-7B-Instruct-v0.3")
|
83 |
# response = response.choices[0].message.content.replace("Magic 8 Ball", "")
|
84 |
# return response, None, None
|
85 |
+
return "Thanks! Since your current code uses sounddevice only indirectly (via ffmpeg_microphone_live), which doesn't actually need sounddevice, we can fully remove sounddevice and its dependency on PortAudio from your code and requirements.txt. But if you want to replace mic audio capture with a pyaudio-based function (i.e., avoiding ffmpeg_microphone_live), I’ll help rewrite the microphone part using pyaudio.", None, None
|
86 |
|
87 |
@spaces.GPU
|
88 |
def read_response(answer):
|
|
|
134 |
gr.HTML("""<h3 style='text-align: center;'> Examples: 'What is the meaning of life?', 'Should I get a dog?' </h3>""")
|
135 |
audio_in.stop_recording(generate_response, audio_in, [state, answer, audio_out]).then(fn=read_response, inputs=state, outputs=[answer, audio_out])
|
136 |
|
137 |
+
block.launch(share=True)
|