Skip to content

Commit 5438a81

Browse files
committed
better type hints, warn once
Signed-off-by: Kyle Sayers <[email protected]>
1 parent a11770a commit 5438a81

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compressed_tensors/utils/helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import numpy
2121
import torch
2222
from frozendict import frozendict
23+
from loguru import logger
2324
from transformers import AutoConfig
2425

2526

@@ -195,7 +196,7 @@ def decorator(func: T) -> T:
195196

196197
@wraps(func)
197198
def wrapped(*args, **kwargs):
198-
warnings.warn(message, DeprecationWarning, stacklevel=2)
199+
logger.bind(log_once=True).warning(message)
199200
return func(*args, **kwargs)
200201

201202
return wrapped

0 commit comments

Comments
 (0)