This commit is contained in:
yumoqing 2024-09-04 20:05:17 +08:00
parent bb0782fa66
commit bdcdde01f6

View File

@ -25,10 +25,9 @@ def save_base64_wav(base64_data, output_file,sample_rate=16000, num_channels=1):
async def generate(request, kw): async def generate(request, kw):
params_kw = kw.get('params_kw', DictObject()) params_kw = kw.get('params_kw', DictObject())
info(f'{params_kw=})
model = params_kw.model model = params_kw.model
audio_file = realpath(params_kw.audio_file) audio_file = params_kw.audio_file
info(f'{params_kw=}, {audio_file=}')
if not audio_file: if not audio_file:
audio = params_kw.audio audio = params_kw.audio
if audio is None: if audio is None:
@ -38,6 +37,8 @@ async def generate(request, kw):
} }
audio_file = temp_file(suffix='.wav') audio_file = temp_file(suffix='.wav')
save_base64_wav(audio, audio_file) save_base64_wav(audio, audio_file)
else:
audio_file = realpath(audio_file)
engine = None engine = None
g = ServerEnv() g = ServerEnv()