Spaces:
Runtime error
Runtime error
Commit
·
f38cdce
1
Parent(s):
f65f35d
correct bug
Browse files
app.py
CHANGED
@@ -334,7 +334,7 @@ def speech_to_text(Filename_Audio_input_single):
|
|
334 |
|
335 |
response = requests.post(endpoint, headers=headers, data=open(Filename_Audio_input_single, "rb"))
|
336 |
print("Speech to Text Raw: ", response.text)
|
337 |
-
text_from_audio = response.text.split('DisplayText":"')[1].split('
|
338 |
# text_from_audio = response.text('DisplayText')
|
339 |
print("Speech to Text: ", text_from_audio)
|
340 |
return text_from_audio
|
@@ -906,6 +906,7 @@ def SingleTalk(WavFile, history5):
|
|
906 |
history5 = history5 + [(ConvertText, None)]
|
907 |
yield [None, None, history5]
|
908 |
message = ConvertText
|
|
|
909 |
try:
|
910 |
response = agent.run(message)
|
911 |
time.sleep(0.1)
|
|
|
334 |
|
335 |
response = requests.post(endpoint, headers=headers, data=open(Filename_Audio_input_single, "rb"))
|
336 |
print("Speech to Text Raw: ", response.text)
|
337 |
+
text_from_audio = response.text.split('DisplayText":"')[1].split('"}')[0]
|
338 |
# text_from_audio = response.text('DisplayText')
|
339 |
print("Speech to Text: ", text_from_audio)
|
340 |
return text_from_audio
|
|
|
906 |
history5 = history5 + [(ConvertText, None)]
|
907 |
yield [None, None, history5]
|
908 |
message = ConvertText
|
909 |
+
history2 = history5
|
910 |
try:
|
911 |
response = agent.run(message)
|
912 |
time.sleep(0.1)
|