Skip to content

Commit 858a0f6

Browse files
committed
Deprecate replace_modules_for_calibration
1 parent bfa02eb commit 858a0f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/llmcompressor/modeling/prepare.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import warnings
2+
13
import tqdm
24
from compressed_tensors.utils import replace_module
35
from transformers import PreTrainedModel
@@ -20,6 +22,14 @@ def replace_modules_for_calibration(
2022
model: PreTrainedModel,
2123
calibrate_all_experts: bool = True,
2224
) -> PreTrainedModel:
25+
# This function is deprecated. Use moe_calibration_context instead.
26+
warnings.warn(
27+
"replace_modules_for_calibration is deprecated. \
28+
Use moe_calibration_context instead.",
29+
DeprecationWarning,
30+
stacklevel=2,
31+
)
32+
2333
for name, module in tqdm.tqdm(list(model.named_modules())):
2434
cls_name = module.__class__.__name__
2535
if cls_name in replacements:

0 commit comments

Comments
 (0)