Upload folder using huggingface_hub
Browse files- .DS_Store +0 -0
- onnx/.DS_Store +0 -0
- sync.py +6 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
onnx/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
sync.py
CHANGED
|
@@ -9,6 +9,12 @@ api = HfApi()
|
|
| 9 |
# Get list of files in repo
|
| 10 |
remote_files = {f for f in api.list_repo_files(repo_id=REPO_ID)}
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# Get list of files locally (recursively)
|
| 13 |
local_files = set()
|
| 14 |
for root, _, files in os.walk(LOCAL_PATH):
|
|
|
|
| 9 |
# Get list of files in repo
|
| 10 |
remote_files = {f for f in api.list_repo_files(repo_id=REPO_ID)}
|
| 11 |
|
| 12 |
+
# Delete .DS_Store files if present in remote
|
| 13 |
+
ds_store_files = {f for f in remote_files if f.endswith('.DS_Store')}
|
| 14 |
+
for file in ds_store_files:
|
| 15 |
+
print(f"Deleting {file} from repo...")
|
| 16 |
+
api.delete_file(path_in_repo=file, repo_id=REPO_ID)
|
| 17 |
+
|
| 18 |
# Get list of files locally (recursively)
|
| 19 |
local_files = set()
|
| 20 |
for root, _, files in os.walk(LOCAL_PATH):
|