38
38
infer_quantization_status ,
39
39
is_kv_cache_quant_scheme ,
40
40
)
41
- from compressed_tensors .utils .helpers import replace_module
41
+ from compressed_tensors .utils .helpers import deprecated , replace_module
42
42
from compressed_tensors .utils .match import match_named_modules , match_targets
43
43
from compressed_tensors .utils .offload import update_parameter_data
44
44
from compressed_tensors .utils .safetensors_load import get_safetensors_folder
@@ -243,15 +243,14 @@ def apply_quantization_status(model: Module, status: QuantizationStatus):
243
243
model .apply (compress_quantized_weights )
244
244
245
245
246
+ @deprecated (
247
+ message = "This function is deprecated and will be removed in a future release."
248
+ "Please use `match_targets` from `compressed_tensors.utils.match` instead."
249
+ )
246
250
def find_name_or_class_matches (
247
251
name : str , module : Module , targets : Iterable [str ], check_contains : bool = False
248
252
) -> List [str ]:
249
253
"""
250
- DEPRECATED: Use `match_targets` instead.
251
-
252
- This function is deprecated and will be removed in a future release.
253
- Please use `match_targets` from `compressed_tensors.utils.match` instead.
254
-
255
254
Returns all targets that match the given name or the class name.
256
255
Returns empty list otherwise.
257
256
The order of the output `matches` list matters.
@@ -260,14 +259,6 @@ def find_name_or_class_matches(
260
259
2. matches on regex patterns
261
260
3. matches on module names
262
261
"""
263
- import warnings
264
-
265
- warnings .warn (
266
- "find_name_or_class_matches is deprecated and will be removed in a future release. "
267
- "Please use compressed_tensors.utils.match.match_targets instead." ,
268
- DeprecationWarning ,
269
- stacklevel = 2 ,
270
- )
271
262
if check_contains :
272
263
raise NotImplementedError (
273
264
"This function is deprecated, and the check_contains=True option has been removed."
0 commit comments