From e9693faa1f1f94875bcc77c89dc88ef9f67d5baf Mon Sep 17 00:00:00 2001 From: blackadder Date: Wed, 5 Nov 2025 13:53:03 +0100 Subject: [PATCH] Changed ends with regex --- inference_lib/src/fp_quant/utils/replace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inference_lib/src/fp_quant/utils/replace.py b/inference_lib/src/fp_quant/utils/replace.py index 842733c..3aef831 100644 --- a/inference_lib/src/fp_quant/utils/replace.py +++ b/inference_lib/src/fp_quant/utils/replace.py @@ -1,4 +1,4 @@ -import torch +import re from torch import nn from .config import FPQuantConfig @@ -40,7 +40,7 @@ def replace_with_fp_quant_linear( # Check if the current key is not in the `quantization_config.modules_to_not_convert` current_key_name_str = ".".join(current_key_name) if not any( - current_key_name_str.endswith(key) + re.search(key, current_key_name_str) is not None for key in fp_quant_linear_config.modules_to_not_convert ): with init_empty_weights():