From 5ba00faf82fd0f3c3c100d5b75b51227e44701cd Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 8 Jul 2025 10:46:49 +0800 Subject: [PATCH] refactor: remove unnecessary tobytes() calls when retrieving file content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1058211 --user=王孝刚 【应用】高级编排-应用对话,图片理解、语音转文本模型执行报错 https://www.tapd.cn/62980211/s/1725144 --- .../speech_to_text_step_node/impl/base_speech_to_text_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/application/flow/step_node/speech_to_text_step_node/impl/base_speech_to_text_node.py b/apps/application/flow/step_node/speech_to_text_step_node/impl/base_speech_to_text_node.py index c533a30c5..50580484e 100644 --- a/apps/application/flow/step_node/speech_to_text_step_node/impl/base_speech_to_text_node.py +++ b/apps/application/flow/step_node/speech_to_text_step_node/impl/base_speech_to_text_node.py @@ -30,7 +30,7 @@ class BaseSpeechToTextNode(ISpeechToTextNode): # 根据file_name 吧文件转成mp3格式 file_format = file.file_name.split('.')[-1] with tempfile.NamedTemporaryFile(delete=False, suffix=f'.{file_format}') as temp_file: - temp_file.write(file.get_bytes().tobytes()) + temp_file.write(file.get_bytes()) temp_file_path = temp_file.name with tempfile.NamedTemporaryFile(delete=False, suffix='.mp3') as temp_amr_file: temp_mp3_path = temp_amr_file.name