fix server_fastapi.py: 修复bug。

This commit is contained in:
Sora
2023-12-04 12:09:56 +08:00
parent 67de3baba2
commit 2b178ba183

View File

@@ -214,7 +214,9 @@ if __name__ == "__main__":
if auto_translate:
text = trans.translate(Sentence=text, to_Language=language.lower())
if reference_audio is not None:
with BytesIO(await reference_audio.read()) as ref_audio:
ref_audio = BytesIO(await reference_audio.read())
else:
ref_audio = reference_audio
if not auto_split:
with torch.no_grad():
audio = infer(