Parse filenames of the form path/to/modelNNNNNN.pt, where NNNNNN is the checkpoint's number of steps.
(filename)
| 256 | |
| 257 | |
| 258 | def 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 | |
| 273 | def get_blob_logdir(): |
no outgoing calls
no test coverage detected