Skip to content

Commit 1a4c1b2

Browse files
committed
fix: stt node error
1 parent 8be91b1 commit 1a4c1b2

File tree

1 file changed

+5
-3
lines changed
  • apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model

1 file changed

+5
-3
lines changed

apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model/stt.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ def speech_to_text(self, audio_file):
6161
result = recognition.call(temp_file_path)
6262
text = ''
6363
if result.status_code == 200:
64-
for sentence in result.get_sentence():
65-
text += sentence['text']
66-
return text
64+
result_sentence = result.get_sentence()
65+
if result_sentence is not None:
66+
for sentence in result_sentence:
67+
text += sentence['text']
68+
return text
6769
else:
6870
raise Exception('Error: ', result.message)
6971
finally:

0 commit comments

Comments
 (0)