File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
optimum/exporters/openvino Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -723,6 +723,13 @@ def export_from_model(
723723 setattr (model .generation_config , param_name , param_value )
724724 setattr (model .config , param_name , None )
725725
726+ # workaround for https://github.com/huggingface/transformers/issues/37172
727+ if is_transformers_version (">=" , "4.50.0" ) and model_type == "whisper" :
728+ if hasattr (model .config , "forced_decoder_ids" ):
729+ model .config .forced_decoder_ids = None
730+ if hasattr (model , "generation_config" ) and hasattr (model .generation_config , "forced_decoder_ids" ):
731+ model .generation_config .input_ids = model .generation_config .forced_decoder_ids
732+ model .generation_config .forced_decoder_ids = None
726733 # Saving the model config and preprocessor as this is needed sometimes.
727734 save_config (model .config , output )
728735 generation_config = getattr (model , "generation_config" , None )
You can’t perform that action at this time.
0 commit comments