Spaces:
Paused
Paused
Update train.py
Browse files
train.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from __future__ import annotations
|
2 |
|
3 |
import os
|
|
|
4 |
import warnings
|
5 |
from logging import getLogger
|
6 |
from multiprocessing import cpu_count
|
@@ -38,7 +39,7 @@ torch.set_float32_matmul_precision("high")
|
|
38 |
|
39 |
from pathlib import Path
|
40 |
|
41 |
-
from huggingface_hub import create_repo, upload_folder, login
|
42 |
|
43 |
if os.environ.get("HF_TOKEN"):
|
44 |
login(os.environ.get("HF_TOKEN"))
|
@@ -75,7 +76,7 @@ class HuggingFacePushCallback(pl.Callback):
|
|
75 |
to_delete = set(repo_ckpts) - set(local_ckpts)
|
76 |
|
77 |
for fname in to_delete:
|
78 |
-
print("π Deleting {fname} from repo")
|
79 |
delete_file(fname, repo_id)
|
80 |
|
81 |
|
|
|
1 |
from __future__ import annotations
|
2 |
|
3 |
import os
|
4 |
+
import re
|
5 |
import warnings
|
6 |
from logging import getLogger
|
7 |
from multiprocessing import cpu_count
|
|
|
39 |
|
40 |
from pathlib import Path
|
41 |
|
42 |
+
from huggingface_hub import create_repo, upload_folder, login, list_repo_files, delete_file
|
43 |
|
44 |
if os.environ.get("HF_TOKEN"):
|
45 |
login(os.environ.get("HF_TOKEN"))
|
|
|
76 |
to_delete = set(repo_ckpts) - set(local_ckpts)
|
77 |
|
78 |
for fname in to_delete:
|
79 |
+
print(f"π Deleting {fname} from repo")
|
80 |
delete_file(fname, repo_id)
|
81 |
|
82 |
|