Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced deprecated logger methods 'logger.warn' for 'logger.warning'. #3355

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/accelerate/utils/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def check_tied_parameters_on_same_device(tied_params, device_map):
for param in tie_param:
tie_param_devices[param] = _get_param_device(param, device_map)
if len(set(tie_param_devices.values())) > 1:
logger.warn(
logger.warning(
f"Tied parameters are on different devices: {tie_param_devices}. "
"Please modify your custom device map or set `device_map='auto'`. "
)
Expand Down Expand Up @@ -1078,7 +1078,7 @@ def _init_infer_auto_device_map(
tied_parameters = find_tied_parameters(model)

if check_tied_parameters_in_config(model) and len(tied_parameters) == 0:
logger.warn(
logger.warning(
"The model weights are not tied. Please use the `tie_weights` method before using the `infer_auto_device` function."
)

Expand Down Expand Up @@ -1596,7 +1596,7 @@ def load_state_dict(checkpoint_file, device_map=None):
weight_names = f.keys()

if metadata is None:
logger.warn(
logger.warning(
f"The safetensors archive passed at {checkpoint_file} does not contain metadata. "
"Make sure to save your model with the `save_pretrained` method. Defaulting to 'pt' metadata."
)
Expand Down Expand Up @@ -1806,7 +1806,7 @@ def load_checkpoint_in_model(
tied_params = find_tied_parameters(model)

if check_tied_parameters_in_config(model) and len(tied_params) == 0:
logger.warn(
logger.warning(
"The model weights are not tied. Please use the `tie_weights` method before using the `infer_auto_device` function."
)
if device_map is not None:
Expand Down
Loading