Skip to content

Commit 5ba00fa

Browse files
committed
refactor: remove unnecessary tobytes() calls when retrieving file content
--bug=1058211 --user=王孝刚 【应用】高级编排-应用对话,图片理解、语音转文本模型执行报错 https://www.tapd.cn/62980211/s/1725144
1 parent 1f1d472 commit 5ba00fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/application/flow/step_node/speech_to_text_step_node/impl/base_speech_to_text_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def process_audio_item(audio_item, model):
3030
# 根据file_name 吧文件转成mp3格式
3131
file_format = file.file_name.split('.')[-1]
3232
with tempfile.NamedTemporaryFile(delete=False, suffix=f'.{file_format}') as temp_file:
33-
temp_file.write(file.get_bytes().tobytes())
33+
temp_file.write(file.get_bytes())
3434
temp_file_path = temp_file.name
3535
with tempfile.NamedTemporaryFile(delete=False, suffix='.mp3') as temp_amr_file:
3636
temp_mp3_path = temp_amr_file.name

0 commit comments

Comments
 (0)