From d1abd59114ada8ba673e1214218cb2878c13b82d Mon Sep 17 00:00:00 2001 From: Marc Sun <57196510+SunMarc@users.noreply.github.com> Date: Tue, 26 Dec 2023 14:21:08 +0100 Subject: [PATCH] fix (#2218) --- src/accelerate/utils/modeling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/accelerate/utils/modeling.py b/src/accelerate/utils/modeling.py index 3e9070b9d0e..fb70d8575e1 100644 --- a/src/accelerate/utils/modeling.py +++ b/src/accelerate/utils/modeling.py @@ -1415,8 +1415,8 @@ def load_checkpoint_in_model( logger.warn( "The model weights are not tied. Please use the `tie_weights` method before using the `infer_auto_device` function." ) - - check_tied_parameters_on_same_device(tied_params, device_map) + if device_map is not None: + check_tied_parameters_on_same_device(tied_params, device_map) if offload_folder is None and device_map is not None and "disk" in device_map.values(): raise ValueError(