_prepare_generation_config bugfix (failed due to version update in transformers)
Browse files- modeling_decilm.py +5 -2
modeling_decilm.py
CHANGED
|
@@ -802,10 +802,13 @@ class DeciLMPreTrainedModel(PreTrainedModel):
|
|
| 802 |
module.weight.data[module.padding_idx].zero_()
|
| 803 |
|
| 804 |
def _prepare_generation_config(
|
| 805 |
-
self,
|
|
|
|
|
|
|
|
|
|
| 806 |
) -> tuple[GenerationConfig, dict]:
|
| 807 |
# DeciLM-specific code
|
| 808 |
-
generation_config, model_kwargs = super()._prepare_generation_config(generation_config, **kwargs)
|
| 809 |
generation_config.cache_implementation = "variable"
|
| 810 |
NEED_SETUP_CACHE_CLASSES_MAPPING["variable"] = VariableCache
|
| 811 |
return generation_config, model_kwargs
|
|
|
|
| 802 |
module.weight.data[module.padding_idx].zero_()
|
| 803 |
|
| 804 |
def _prepare_generation_config(
|
| 805 |
+
self,
|
| 806 |
+
generation_config: Optional[GenerationConfig],
|
| 807 |
+
*args,
|
| 808 |
+
**kwargs,
|
| 809 |
) -> tuple[GenerationConfig, dict]:
|
| 810 |
# DeciLM-specific code
|
| 811 |
+
generation_config, model_kwargs = super()._prepare_generation_config(generation_config, *args, **kwargs)
|
| 812 |
generation_config.cache_implementation = "variable"
|
| 813 |
NEED_SETUP_CACHE_CLASSES_MAPPING["variable"] = VariableCache
|
| 814 |
return generation_config, model_kwargs
|