Skip to content
代码片段 群组 项目
未验证 提交 11bb8866 编辑于 作者: Hung Chia Yu's avatar Hung Chia Yu 提交者: system
浏览文件

Update handler.py

上级 63961927
分支 main
无相关合并请求
......@@ -4,6 +4,7 @@ import torchaudio
from huggingface_inference_toolkit.logging import logger
import io
import base64
class EndpointHandler():
def __init__(self, path=""):
......@@ -47,5 +48,5 @@ class EndpointHandler():
buffer = io.BytesIO()
torchaudio.save(buffer, audio, 44100, format="wav")
buffer.seek(0)
return buffer.read()
\ No newline at end of file
audio_base64 = base64.b64encode(buffer.read()).decode('utf-8')
return audio_base64
\ No newline at end of file
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册