(folder)
| 268 | |
| 269 | |
| 270 | def get_last_checkpoint(folder): |
| 271 | content = os.listdir(folder) |
| 272 | checkpoints = [ |
| 273 | path |
| 274 | for path in content |
| 275 | if _re_checkpoint.search(path) is not None and os.path.isdir(os.path.join(folder, path)) |
| 276 | ] |
| 277 | if len(checkpoints) == 0: |
| 278 | return |
| 279 | return os.path.join(folder, max(checkpoints, key=lambda x: int(_re_checkpoint.search(x).groups()[0]))) |
| 280 | |
| 281 | |
| 282 | def sort_checkpoints( |