Fix RuntimeError not caught when torchcodec fails to load (#3987)
When datasets library has torchcodec installed but FFmpeg libraries are missing, torchcodec raises a RuntimeError during import. The exception handler only caught ImportError and AttributeError, causing the error to propagate and crash Unsloth imports in environments like Colab where FFmpeg may not be installed. Co-authored-by: Daniel Han <danielhanchen@users.noreply.github.com>
This commit is contained in:
parent
67e30ae5ed
commit
5f9dfadb19
1 changed files with 1 additions and 1 deletions
|
|
@ -1051,5 +1051,5 @@ def patch_torchcodec_audio_decoder():
|
|||
from unsloth_zoo.dataset_utils import patch_torchcodec_audio_decoder as _patch
|
||||
|
||||
_patch()
|
||||
except (ImportError, AttributeError):
|
||||
except (ImportError, AttributeError, RuntimeError):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue