Spaces:
Sleeping
Sleeping
File size: 1,205 Bytes
c9f1dfc fdb27f4 c9f1dfc ce339c7 c9f1dfc ce339c7 c9f1dfc ce339c7 c9f1dfc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | import sys
from huggingface_hub import HfApi, create_repo
repo_id = "Ypeng12/InferRoute"
print(f"Checking/Creating Space repository '{repo_id}' on Hugging Face...")
api = HfApi()
try:
url = create_repo(
repo_id=repo_id,
repo_type="space",
space_sdk="docker",
private=False,
exist_ok=True
)
print(f"Space repository ready at: {url}")
except Exception as e:
print(f"Repo notice: {e}")
print("Uploading InferRoute + Quant.ai files to Hugging Face Space...")
api.upload_folder(
folder_path="c:/Users/pengy/OneDrive/Desktop/InferRoute",
repo_id=repo_id,
repo_type="space",
ignore_patterns=[
"*.pyc",
"__pycache__/*",
"**/__pycache__/*",
".git",
".git/*",
"**/.git/*",
".venv",
".venv/*",
"**/.venv/*",
".pytest_cache",
".pytest_cache/*",
"**/.pytest_cache/*",
"node_modules",
"node_modules/*",
"**/node_modules/*",
"scratch/*",
"*.pdf",
".gemini/*",
"inferroute.db"
]
)
print("Upload completed successfully!")
print(f"Space live URL: https://huggingface.co/spaces/{repo_id}")
|