Spaces:
Runtime error
Runtime error
Delete upload.py
Browse files
upload.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
| 1 |
-
from huggingface_hub import HfApi
|
| 2 |
-
|
| 3 |
-
api = HfApi()
|
| 4 |
-
|
| 5 |
-
repo_id = "kunal89/Lora_train1"
|
| 6 |
-
|
| 7 |
-
print(f"Checking if Space '{repo_id}' exists...")
|
| 8 |
-
|
| 9 |
-
try:
|
| 10 |
-
api.repo_info(repo_id=repo_id, repo_type="space")
|
| 11 |
-
print("Space exists. Proceeding with upload...")
|
| 12 |
-
except Exception as e:
|
| 13 |
-
print("Space doesn't exist. Creating it now...")
|
| 14 |
-
api.create_repo(
|
| 15 |
-
repo_id=repo_id,
|
| 16 |
-
repo_type="space",
|
| 17 |
-
space_sdk="docker",
|
| 18 |
-
exist_ok=True
|
| 19 |
-
)
|
| 20 |
-
print("Space created successfully.")
|
| 21 |
-
|
| 22 |
-
print("Uploading ui/prisma folder...")
|
| 23 |
-
|
| 24 |
-
api.upload_folder(
|
| 25 |
-
repo_id=repo_id,
|
| 26 |
-
repo_type="space",
|
| 27 |
-
folder_path="ui/prisma",
|
| 28 |
-
path_in_repo="ui/prisma", # This will upload to ui/prisma in the Space
|
| 29 |
-
commit_message="Upload ui/prisma folder",
|
| 30 |
-
)
|
| 31 |
-
|
| 32 |
-
print("Upload completed successfully!")
|
| 33 |
-
print(f"View your Space at: https://huggingface.co/spaces/{repo_id}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|