File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 25
25
from modelopt .torch .export .unified_export_hf import _export_hf_checkpoint
26
26
from modelopt .torch .opt .conversion import restore_from_modelopt_state
27
27
from modelopt .torch .quantization .utils import set_quantizer_state_dict
28
+ from modelopt .torch .utils import print_rank_0
28
29
29
30
RAND_SEED = 1234
30
31
@@ -46,12 +47,13 @@ def get_lora_model(
46
47
# Restore modelopt state
47
48
modelopt_state = torch .load (f"{ ckpt_path } /modelopt_state_calib.pth" , weights_only = False )
48
49
restore_from_modelopt_state (model , modelopt_state )
50
+ print_rank_0 ("Restored modelopt state" )
49
51
50
52
# Restore modelopt quantizer state dict
51
53
modelopt_weights = modelopt_state .pop ("modelopt_state_weights" , None )
52
54
if modelopt_weights is not None :
53
- print ("Restoring modelopt weights" )
54
55
set_quantizer_state_dict (model , modelopt_weights )
56
+ print_rank_0 ("Restored modelopt quantizer state dict" )
55
57
56
58
return model
57
59
You can’t perform that action at this time.
0 commit comments