We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8be91b1 commit 1a4c1b2Copy full SHA for 1a4c1b2
apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model/stt.py
@@ -61,9 +61,11 @@ def speech_to_text(self, audio_file):
61
result = recognition.call(temp_file_path)
62
text = ''
63
if result.status_code == 200:
64
- for sentence in result.get_sentence():
65
- text += sentence['text']
66
- return text
+ result_sentence = result.get_sentence()
+ if result_sentence is not None:
+ for sentence in result_sentence:
67
+ text += sentence['text']
68
+ return text
69
else:
70
raise Exception('Error: ', result.message)
71
finally:
0 commit comments