Spaces:
Running on Zero
Running on Zero
feat: update so can also delete files
Browse files- storage.py +5 -0
storage.py
CHANGED
|
@@ -58,6 +58,11 @@ def load_run(repo_path: str) -> dict:
|
|
| 58 |
return _cache[repo_path]
|
| 59 |
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
def delete_run(repo_path: str) -> None:
|
| 62 |
api.delete_file(repo_path, repo_id=REPO_ID, repo_type="dataset",
|
| 63 |
commit_message=f"Delete {repo_path}")
|
|
|
|
| 58 |
return _cache[repo_path]
|
| 59 |
|
| 60 |
|
| 61 |
+
def local_path(repo_path: str) -> str:
|
| 62 |
+
"""Local cached file path for a run (used for the download button)."""
|
| 63 |
+
return hf_hub_download(REPO_ID, repo_path, repo_type="dataset", token=TOKEN)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
def delete_run(repo_path: str) -> None:
|
| 67 |
api.delete_file(repo_path, repo_id=REPO_ID, repo_type="dataset",
|
| 68 |
commit_message=f"Delete {repo_path}")
|