Loading SenseVoice with FunASR crashes with:
AttributeError: 'SinusoidalPositionEncoder' object has no attribute '_state_dict_pre_hooks'
This happens during model initialization (before inference finishes), and prevents transcription jobs from completing.
To Reproduce
Build and run SenseVoice service.
Install/run FunASR path that loads iic/SenseVoiceSmall.
Execute:
or in app context:
Observe crash trace:
Expected behavior
Model loads successfully and transcription runs normally.
Actual behavior
Model load fails with _state_dict_pre_hooks AttributeError in SinusoidalPositionEncoder.
Environment
SenseVoice model: iic/SenseVoiceSmall
Backend: FunASR (AutoModel)
Runtime: Python 3.11
PyTorch runtime observed: 2.4.1+cu121
Containerized deployment (Docker)
Additional context
The issue appears related to SinusoidalPositionEncoder.init not initializing torch.nn.Module state (missing super().init()), which leads to missing internal hook fields used by state_dict().
Loading SenseVoice with FunASR crashes with:
AttributeError: 'SinusoidalPositionEncoder' object has no attribute '_state_dict_pre_hooks'
This happens during model initialization (before inference finishes), and prevents transcription jobs from completing.
To Reproduce
Build and run SenseVoice service.
Install/run FunASR path that loads iic/SenseVoiceSmall.
Execute:
or in app context:
Observe crash trace:
Expected behavior
Model loads successfully and transcription runs normally.
Actual behavior
Model load fails with _state_dict_pre_hooks AttributeError in SinusoidalPositionEncoder.
Environment
SenseVoice model: iic/SenseVoiceSmall
Backend: FunASR (AutoModel)
Runtime: Python 3.11
PyTorch runtime observed: 2.4.1+cu121
Containerized deployment (Docker)
Additional context
The issue appears related to SinusoidalPositionEncoder.init not initializing torch.nn.Module state (missing super().init()), which leads to missing internal hook fields used by state_dict().