Add models cleanup to training script

This commit is contained in:
Filip Stefaniuk 2024-09-07 08:09:33 -04:00
parent 9109be5776
commit 03bd6ad9d8

View File

@ -251,7 +251,11 @@ def main():
batch_size=batch_size, train=False, num_workers=3), batch_size=batch_size, train=False, num_workers=3),
ckpt_path=ckpt_path) ckpt_path=ckpt_path)
# TODO: Clean up non-best models to save space on wandb # Clean up models that do not have best/latest tags, to save space on wandb
for artifact in wandb.Api().run(run.path).logged_artifacts():
if artifact.type == "model" and not artifact.aliases:
logging.info(f"Deleting artifact {artifact.name}")
artifact.delete()
if __name__ == '__main__': if __name__ == '__main__':