_prepare_generation_config bugfix (failed due to version update in transformers) (#25)
Browse files- _prepare_generation_config bugfix (failed due to version update in transformers) (aabac526c6963d3107659c16ef56c50408e96b65)
Co-authored-by: Ido Shahaf <ishahaf@users.noreply.huggingface.co>
- modeling_decilm.py +5 -2
modeling_decilm.py
CHANGED
|
@@ -833,10 +833,13 @@ class DeciLMPreTrainedModel(PreTrainedModel):
|
|
| 833 |
module.weight.data[module.padding_idx].zero_()
|
| 834 |
|
| 835 |
def _prepare_generation_config(
|
| 836 |
-
self,
|
|
|
|
|
|
|
|
|
|
| 837 |
) -> tuple[GenerationConfig, dict]:
|
| 838 |
# DeciLM-specific code
|
| 839 |
-
generation_config, model_kwargs = super()._prepare_generation_config(generation_config, **kwargs)
|
| 840 |
generation_config.cache_implementation = "variable"
|
| 841 |
NEED_SETUP_CACHE_CLASSES_MAPPING["variable"] = VariableCache
|
| 842 |
return generation_config, model_kwargs
|
|
|
|
| 833 |
module.weight.data[module.padding_idx].zero_()
|
| 834 |
|
| 835 |
def _prepare_generation_config(
|
| 836 |
+
self,
|
| 837 |
+
generation_config: Optional[GenerationConfig],
|
| 838 |
+
*args,
|
| 839 |
+
**kwargs,
|
| 840 |
) -> tuple[GenerationConfig, dict]:
|
| 841 |
# DeciLM-specific code
|
| 842 |
+
generation_config, model_kwargs = super()._prepare_generation_config(generation_config, *args, **kwargs)
|
| 843 |
generation_config.cache_implementation = "variable"
|
| 844 |
NEED_SETUP_CACHE_CLASSES_MAPPING["variable"] = VariableCache
|
| 845 |
return generation_config, model_kwargs
|