Skip to content

Commit 9917b6b

Browse files
committed
fix pkv filling according model code
1 parent 47af979 commit 9917b6b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

optimum/exporters/openvino/model_configs.py

+6
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,12 @@ def patch_model_for_export(
485485
library_name="transformers",
486486
)
487487
class Phi3OpenVINOConfig(PhiOnnxConfig):
488+
DUMMY_INPUT_GENERATOR_CLASSES = (
489+
MistralDummyPastKeyValuesGenerator,
490+
) + TextDecoderOnnxConfig.DUMMY_INPUT_GENERATOR_CLASSES
491+
DUMMY_PKV_GENERATOR_CLASS = MistralDummyPastKeyValuesGenerator
492+
NORMALIZED_CONFIG_CLASS = NormalizedTextConfig.with_args(num_key_value_heads="num_key_value_heads", allow_new=True)
493+
488494
def patch_model_for_export(
489495
self, model: Union["PreTrainedModel", "TFPreTrainedModel"], model_kwargs: Optional[Dict[str, Any]] = None
490496
) -> "ModelPatcher":

0 commit comments

Comments
 (0)