Spaces:
Sleeping
Sleeping
remove delete option
Browse files12345678910111213141516171819202122232425from huggingface_hub import HfApiimport shutil, osfrom dotenv import load_dotenv
load_dotenv()HF_DATA_REPO_ID = os.getenv("HF_DATA_REPO_ID")HF_DATA_TOKEN = os.getenv("HF_DATA_TOKEN")
api = HfApi()
# 1๏ธโฃ ๋ชจ๋ ํ์ผ ์ญ์ files = api.list_repo_files(repo_id=HF_DATA_REPO_ID, repo_type="dataset", token=HF_DATA_TOKEN)for path in files: api.delete_file(path_in_repo=path, repo_id=HF_DATA_REPO_ID, repo_type="dataset", token=HF_DATA_TOKEN)print("๐๏ธ repo ๋ด๋ถ ํ์ผ ๋ชจ๋ ์ญ์ ์๋ฃ")
# 2๏ธโฃ ์บ์ ์ญ์ cache_dir = os.path.expanduser("~/.cache/huggingface/datasets")if os.path.exists(cache_dir): shutil.rmtree(cache_dir)print("๐งน ๋ก์ปฌ ์บ์ ์ด๊ธฐํ ์๋ฃ")
# 3๏ธโฃ repo ๋ฉํ๋ฐ์ดํฐ ์ด๊ธฐํapi.create_repo(HF_DATA_REPO_ID, repo_type="dataset", token=HF_DATA_TOKEN, exist_ok=True, private=True)print("โ
dataset repo metadata ์ฌ์ค์ ์๋ฃ (๋น ์ํ)")deleteAll.pyDeleted-25