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
|
||||
audio_tensors = model.generate(**kwargs)
|
||||
finally:
|
||||
try:
|
||||
os.unlink(tmp_path)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
elif mode == "voice_design" and instruct:
|
||||
kwargs["instruct"] = instruct
|
||||
|
||||
Reference in New Issue
Block a user