Error when loading audio processor saved with processor.save_pretrained(path_to_dir), and num_logits_to_keep wrong init value
- After fine-tuning the model on a speech task, I attempted to save both the model and the processor using processor.save_pretrained(path_to_dir). However, when loading the model, I encountered an error due to mismatches between the processor's saved fields and the expected input arguments:
audio_compression_rate β compression_rate
qformer_compression_rate β audio_downsample_rate
audio_feat_stride β feat_stride
Additionally, some arguments such as feature_size, sampling_rate, and padding_value are hardcoded in the processor, causing the loading process to fail when they are encountered again
- If the user does not provide the num_logits_to_keep argument, the code fails because in modeling_phi4mm.py, within the prepare_inputs_for_generation function, the argument is initialized with None instead of a default value- 0.
I'm experiencing the same issue:
TypeError: Phi4MMAudioFeatureExtractor.__init__() missing 3 required positional arguments: 'audio_compression_rate', 'audio_downsample_rate', and 'audio_feat_stride'
To work around this, I used the base model's processor. However, my fine-tuned model is now hallucinating, and I'm unsure if this is the cause.
Does anyone have any solutions or suggestions for this issue?
Running into the same issue.
Same issue here, what can solve the problem?
What I exactly did to "temporary" solve:
- in
preprocessor_config.json
compression_rate
renamed intoaudio_compression_rate
(as suggested by @YaelAiola )feat_stride
renamed intoaudio_feat_stride
(as suggested by @YaelAiola )qformer_compression_rate
renamed intoaudio_downsample_rate
(as suggested by @YaelAiola )- deleted
padding_value
field tout-court - deleted
feature_size
field tout-court - deleted
sampling_rate
field tout-court
- still got the error about
chat_template
having no setter -> I deleted thechat_template.json
file (actually renamed it to do not loose it, but have the same effect), as it is ontokenizer_config.json
Hopefully this will save a few hours to some of you.