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 1616
1717from typing import TYPE_CHECKING
1818
19- from ...neuron .models .training import consolidate_model_parallel_checkpoints_to_unified_checkpoint
2019from ...utils import logging
2120from ..base import BaseOptimumCLICommand
2221
@@ -53,6 +52,9 @@ def parse_args(parser: "ArgumentParser"):
5352 )
5453
5554 def run (self ):
55+ # This is not on top otherwise it will make the CLI require neuronx_distributed
56+ from ...neuron .models .training import consolidate_model_parallel_checkpoints_to_unified_checkpoint
57+
5658 checkpoint_format = "safetensors" if self .args .format == "safetensors" else "pytorch"
5759 logger .info (f"Consolidating checkpoints from { self .args .checkpoint_dir } to the { checkpoint_format } format..." )
5860 output_dir = self .args .output_dir
You can’t perform that action at this time.
0 commit comments