MCPcopy Index your code
hub / github.com/openai/guided-diffusion / parse_resume_step_from_filename

Function parse_resume_step_from_filename

guided_diffusion/train_util.py:258–270  ·  view source on GitHub ↗

Parse filenames of the form path/to/modelNNNNNN.pt, where NNNNNN is the checkpoint's number of steps.

(filename)

Source from the content-addressed store, hash-verified

256
257
258def parse_resume_step_from_filename(filename):
259 """
260 Parse filenames of the form path/to/modelNNNNNN.pt, where NNNNNN is the
261 checkpoint's number of steps.
262 """
263 split = filename.split("model")
264 if len(split) < 2:
265 return 0
266 split1 = split[-1].split(".")[0]
267 try:
268 return int(split1)
269 except ValueError:
270 return 0
271
272
273def get_blob_logdir():

Callers 2

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected