File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ def load_pretrained(
185185 check_hash = _CHECK_HASH ,
186186 weights_only = True ,
187187 )
188- except ValueError :
188+ except TypeError :
189189 state_dict = load_state_dict_from_url (
190190 pretrained_loc ,
191191 map_location = 'cpu' ,
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def load_state_dict(
5454 else :
5555 try :
5656 checkpoint = torch .load (checkpoint_path , map_location = device , weights_only = weights_only )
57- except ValueError :
57+ except TypeError :
5858 checkpoint = torch .load (checkpoint_path , map_location = device )
5959
6060 state_dict_key = ''
Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ def load_state_dict_from_hf(
193193 _logger .debug (f"[{ model_id } ] Safe alternative not found for '{ filename } '. Loading weights using default pytorch." )
194194 try :
195195 state_dict = torch .load (cached_file , map_location = 'cpu' , weights_only = weights_only )
196- except ValueError :
196+ except TypeError :
197197 state_dict = torch .load (cached_file , map_location = 'cpu' )
198198 return state_dict
199199
You can’t perform that action at this time.
0 commit comments