mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
revert: mager操作錯誤
This commit is contained in:
parent
6d99548e8e
commit
1e2a0b877b
2 changed files with 10 additions and 4 deletions
|
|
@ -116,8 +116,11 @@ class TTSProvider(TTSProviderBase):
|
||||||
|
|
||||||
resp = requests.post(self.url, json=request_json)
|
resp = requests.post(self.url, json=request_json)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
|
if output_file:
|
||||||
with open(output_file, "wb") as file:
|
with open(output_file, "wb") as file:
|
||||||
file.write(resp.content)
|
file.write(resp.content)
|
||||||
|
else:
|
||||||
|
return resp.content
|
||||||
else:
|
else:
|
||||||
error_msg = f"GPT_SoVITS_V2 TTS请求失败: {resp.status_code} - {resp.text}"
|
error_msg = f"GPT_SoVITS_V2 TTS请求失败: {resp.status_code} - {resp.text}"
|
||||||
logger.bind(tag=TAG).error(error_msg)
|
logger.bind(tag=TAG).error(error_msg)
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,11 @@ class TTSProvider(TTSProviderBase):
|
||||||
|
|
||||||
resp = requests.get(self.url, params=request_params)
|
resp = requests.get(self.url, params=request_params)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
|
if output_file:
|
||||||
with open(output_file, "wb") as file:
|
with open(output_file, "wb") as file:
|
||||||
file.write(resp.content)
|
file.write(resp.content)
|
||||||
|
else:
|
||||||
|
return resp.content
|
||||||
else:
|
else:
|
||||||
error_msg = f"GPT_SoVITS_V3 TTS请求失败: {resp.status_code} - {resp.text}"
|
error_msg = f"GPT_SoVITS_V3 TTS请求失败: {resp.status_code} - {resp.text}"
|
||||||
logger.bind(tag=TAG).error(error_msg)
|
logger.bind(tag=TAG).error(error_msg)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue