Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -138,8 +138,9 @@ class ConversationBot:
|
|
138 |
print("Inputs:", file, state)
|
139 |
print("======>Previous memory:\n %s" % self.agent.memory)
|
140 |
audio_filename = os.path.join('audio', str(uuid.uuid4())[0:8] + ".wav")
|
141 |
-
audio_load = whisper.load_audio(file.name)
|
142 |
-
|
|
|
143 |
description = self.models['A2T'].inference(audio_filename)
|
144 |
Human_prompt = "\nHuman: provide an audio named {}. The description is: {}. This information helps you to understand this audio, but you should use tools to finish following tasks, " \
|
145 |
"rather than directly imagine from my description. If you understand, say \"Received\". \n".format(audio_filename, description)
|
|
|
138 |
print("Inputs:", file, state)
|
139 |
print("======>Previous memory:\n %s" % self.agent.memory)
|
140 |
audio_filename = os.path.join('audio', str(uuid.uuid4())[0:8] + ".wav")
|
141 |
+
# audio_load = whisper.load_audio(file.name)
|
142 |
+
audio_load, sr = soundfile.read(file.name)
|
143 |
+
soundfile.write(audio_filename, audio_load, samplerate = sr)
|
144 |
description = self.models['A2T'].inference(audio_filename)
|
145 |
Human_prompt = "\nHuman: provide an audio named {}. The description is: {}. This information helps you to understand this audio, but you should use tools to finish following tasks, " \
|
146 |
"rather than directly imagine from my description. If you understand, say \"Received\". \n".format(audio_filename, description)
|