From dcbd9d45a9b60a918b89506a57eb251f22b4d368 Mon Sep 17 00:00:00 2001 From: Victor Hall Date: Tue, 18 Jun 2024 18:23:31 -0400 Subject: [PATCH] add kwargs to cog patch for compatibility with newer diffusers versions --- utils/patch_cog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/patch_cog.py b/utils/patch_cog.py index 16147d5..7834d57 100644 --- a/utils/patch_cog.py +++ b/utils/patch_cog.py @@ -7,7 +7,7 @@ from transformers.modeling_utils import PreTrainedModel # CogVLM stores inv_freq in the state dictionary but it is not in models._parameters so it cannot be quantized # was patched in transformers for other models here: https://github.com/huggingface/transformers/pull/28837/files but cog is not part of transformers def _patched_check_quantized_param( - self, model: "PreTrainedModel", param_value: "torch.Tensor", param_name: str, state_dict: Dict[str, Any] + self, model: "PreTrainedModel", param_value: "torch.Tensor", param_name: str, state_dict: Dict[str, Any], **kwargs ) -> bool: # if "inv_freq" in param_name: # detect failure case