Spaces:
Sleeping
Sleeping
remove delete option
Browse files- deleteAll.py +0 -25
deleteAll.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
| 1 |
-
from huggingface_hub import HfApi
|
| 2 |
-
import shutil, os
|
| 3 |
-
from dotenv import load_dotenv
|
| 4 |
-
|
| 5 |
-
load_dotenv()
|
| 6 |
-
HF_DATA_REPO_ID = os.getenv("HF_DATA_REPO_ID")
|
| 7 |
-
HF_DATA_TOKEN = os.getenv("HF_DATA_TOKEN")
|
| 8 |
-
|
| 9 |
-
api = HfApi()
|
| 10 |
-
|
| 11 |
-
# 1๏ธโฃ ๋ชจ๋ ํ์ผ ์ญ์
|
| 12 |
-
files = api.list_repo_files(repo_id=HF_DATA_REPO_ID, repo_type="dataset", token=HF_DATA_TOKEN)
|
| 13 |
-
for path in files:
|
| 14 |
-
api.delete_file(path_in_repo=path, repo_id=HF_DATA_REPO_ID, repo_type="dataset", token=HF_DATA_TOKEN)
|
| 15 |
-
print("๐๏ธ repo ๋ด๋ถ ํ์ผ ๋ชจ๋ ์ญ์ ์๋ฃ")
|
| 16 |
-
|
| 17 |
-
# 2๏ธโฃ ์บ์ ์ญ์
|
| 18 |
-
cache_dir = os.path.expanduser("~/.cache/huggingface/datasets")
|
| 19 |
-
if os.path.exists(cache_dir):
|
| 20 |
-
shutil.rmtree(cache_dir)
|
| 21 |
-
print("๐งน ๋ก์ปฌ ์บ์ ์ด๊ธฐํ ์๋ฃ")
|
| 22 |
-
|
| 23 |
-
# 3๏ธโฃ repo ๋ฉํ๋ฐ์ดํฐ ์ด๊ธฐํ
|
| 24 |
-
api.create_repo(HF_DATA_REPO_ID, repo_type="dataset", token=HF_DATA_TOKEN, exist_ok=True, private=True)
|
| 25 |
-
print("โ
dataset repo metadata ์ฌ์ค์ ์๋ฃ (๋น ์ํ)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|