fix: protect os.unlink in finally block from masking original exceptions
This commit is contained in:
@@ -50,7 +50,10 @@ class OmniVoiceGenerate:
|
|||||||
kwargs["ref_text"] = ref_text
|
kwargs["ref_text"] = ref_text
|
||||||
audio_tensors = model.generate(**kwargs)
|
audio_tensors = model.generate(**kwargs)
|
||||||
finally:
|
finally:
|
||||||
|
try:
|
||||||
os.unlink(tmp_path)
|
os.unlink(tmp_path)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
elif mode == "voice_design" and instruct:
|
elif mode == "voice_design" and instruct:
|
||||||
kwargs["instruct"] = instruct
|
kwargs["instruct"] = instruct
|
||||||
|
|||||||
Reference in New Issue
Block a user