This commit is contained in:
0Xiao0
2024-10-11 20:45:06 +08:00
parent 416978f6c6
commit b17fcf0feb

View File

@ -85,7 +85,7 @@ class ASR(Blackbox):
print(f"asr_model_name: {user_model_name}") print(f"asr_model_name: {user_model_name}")
data = args[0] data = args[0]
if user_model_name == 'sensevoice' or ['sensevoice']: if 'sensevoice' in user_model_name:
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as temp_audio_file: with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as temp_audio_file:
temp_audio_file.write(data) temp_audio_file.write(data)
temp_audio_path = temp_audio_file.name temp_audio_path = temp_audio_file.name
@ -106,8 +106,7 @@ class ASR(Blackbox):
results = converter.convert(results) results = converter.convert(results)
return results return results
elif user_model_name == 'funasr' or ['funasr']: elif 'funasr' in user_model_name:
results = converter.convert(results) results = converter.convert(results)
return results return results