MCPcopy Create free account
hub / github.com/modelscope/modelscope / get_checkpoint_name

Function get_checkpoint_name

modelscope/models/nlp/mglm/utils.py:180–193  ·  view source on GitHub ↗
(checkpoints_path,
                        iteration,
                        release=False,
                        zero=False)

Source from the content-addressed store, hash-verified

178
179
180def get_checkpoint_name(checkpoints_path,
181 iteration,
182 release=False,
183 zero=False):
184 if release:
185 d = 'release'
186 else:
187 d = '{}'.format(iteration)
188 if zero:
189 dp_rank = mpu.get_data_parallel_rank()
190 d += '_zero_dp_rank_{}'.format(dp_rank)
191 return os.path.join(
192 checkpoints_path, d,
193 'mp_rank_{:02d}_model_states.pt'.format(mpu.get_model_parallel_rank()))
194
195
196def ensure_directory_exists(filename):

Callers 4

save_zero_checkpointFunction · 0.85
save_checkpointFunction · 0.85
load_checkpointFunction · 0.85
load_pretrainedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…