This repository was archived by the owner on Sep 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed
model_executor/model_loader Expand file tree Collapse file tree 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:
2727 """
2828 image_path = get_vllm_public_assets (filename = f"{ self .name } .pt" ,
2929 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(
277277 new_embeddings_tensor_path )
278278 elif os .path .isfile (new_embeddings_bin_file_path ):
279279 embeddings = torch .load (new_embeddings_bin_file_path ,
280- map_location = device )
280+ map_location = device ,
281+ weights_only = True )
281282
282283 return cls .from_lora_tensors (
283284 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(
8383 pt_filename : str ,
8484 sf_filename : str ,
8585) -> None :
86- loaded = torch .load (pt_filename , map_location = "cpu" )
86+ loaded = torch .load (pt_filename , map_location = "cpu" , weights_only = True )
8787 if "state_dict" in loaded :
8888 loaded = loaded ["state_dict" ]
8989 shared = _shared_pointers (loaded )
@@ -371,7 +371,9 @@ def np_cache_weights_iterator(
371371 disable = not enable_tqdm ,
372372 bar_format = _BAR_FORMAT ,
373373 ):
374- state = torch .load (bin_file , map_location = "cpu" )
374+ state = torch .load (bin_file ,
375+ map_location = "cpu" ,
376+ weights_only = True )
375377 for name , param in state .items ():
376378 param_path = os .path .join (np_folder , name )
377379 with open (param_path , "wb" ) as f :
@@ -420,7 +422,7 @@ def pt_weights_iterator(
420422 disable = not enable_tqdm ,
421423 bar_format = _BAR_FORMAT ,
422424 ):
423- state = torch .load (bin_file , map_location = "cpu" )
425+ state = torch .load (bin_file , map_location = "cpu" , weights_only = True )
424426 yield from state .items ()
425427 del state
426428 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,
8989 adapters_weights = safe_load_file (filename , device = device )
9090 else :
9191 adapters_weights = torch .load (filename ,
92- map_location = torch .device (device ))
92+ map_location = torch .device (device ),
93+ weights_only = True )
9394
9495 return adapters_weights
You can’t perform that action at this time.
0 commit comments