File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -365,7 +365,7 @@ def run(
365
365
weights_path = Path (f"static_quant_scalars/{ sam_model_type } _{ batch_size } _static_quant_weights.ptk" )
366
366
if weights_path .exists () and weights_path .is_file ():
367
367
print ("Loading static quantization weights" )
368
- weights = torch .load (f"static_quant_scalars/{ sam_model_type } _{ batch_size } _static_quant_weights.ptk" )
368
+ weights = torch .load (f"static_quant_scalars/{ sam_model_type } _{ batch_size } _static_quant_weights.ptk" , weights_only = True )
369
369
from static_quant import set_x_absmax
370
370
set_x_absmax (predictor .model .image_encoder , weights )
371
371
elif compress == "sparse" :
Original file line number Diff line number Diff line change @@ -142,6 +142,6 @@ def _build_sam(
142
142
sam .eval ()
143
143
if checkpoint is not None :
144
144
with open (checkpoint , "rb" ) as f :
145
- state_dict = torch .load (f )
145
+ state_dict = torch .load (f , weights_only = True )
146
146
sam .load_state_dict (state_dict )
147
147
return sam
You can’t perform that action at this time.
0 commit comments