File tree 4 files changed +10
-6
lines changed
model_executor/model_loader
4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -27,4 +27,4 @@ def image_embeds(self) -> torch.Tensor:
27
27
"""
28
28
image_path = get_vllm_public_assets (filename = f"{ self .name } .pt" ,
29
29
s3_prefix = VLM_IMAGES_DIR )
30
- return torch .load (image_path , map_location = "cpu" )
30
+ return torch .load (image_path , map_location = "cpu" , weights_only = True )
Original file line number Diff line number Diff line change @@ -277,7 +277,8 @@ def from_local_checkpoint(
277
277
new_embeddings_tensor_path )
278
278
elif os .path .isfile (new_embeddings_bin_file_path ):
279
279
embeddings = torch .load (new_embeddings_bin_file_path ,
280
- map_location = device )
280
+ map_location = device ,
281
+ weights_only = True )
281
282
282
283
return cls .from_lora_tensors (
283
284
lora_model_id = get_lora_id ()
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ def convert_bin_to_safetensor_file(
83
83
pt_filename : str ,
84
84
sf_filename : str ,
85
85
) -> None :
86
- loaded = torch .load (pt_filename , map_location = "cpu" )
86
+ loaded = torch .load (pt_filename , map_location = "cpu" , weights_only = True )
87
87
if "state_dict" in loaded :
88
88
loaded = loaded ["state_dict" ]
89
89
shared = _shared_pointers (loaded )
@@ -371,7 +371,9 @@ def np_cache_weights_iterator(
371
371
disable = not enable_tqdm ,
372
372
bar_format = _BAR_FORMAT ,
373
373
):
374
- state = torch .load (bin_file , map_location = "cpu" )
374
+ state = torch .load (bin_file ,
375
+ map_location = "cpu" ,
376
+ weights_only = True )
375
377
for name , param in state .items ():
376
378
param_path = os .path .join (np_folder , name )
377
379
with open (param_path , "wb" ) as f :
@@ -420,7 +422,7 @@ def pt_weights_iterator(
420
422
disable = not enable_tqdm ,
421
423
bar_format = _BAR_FORMAT ,
422
424
):
423
- state = torch .load (bin_file , map_location = "cpu" )
425
+ state = torch .load (bin_file , map_location = "cpu" , weights_only = True )
424
426
yield from state .items ()
425
427
del state
426
428
torch .cuda .empty_cache ()
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ def load_peft_weights(model_id: str,
89
89
adapters_weights = safe_load_file (filename , device = device )
90
90
else :
91
91
adapters_weights = torch .load (filename ,
92
- map_location = torch .device (device ))
92
+ map_location = torch .device (device ),
93
+ weights_only = True )
93
94
94
95
return adapters_weights
You can’t perform that action at this time.
0 commit comments