Spaces:
Running
Running
File size: 1,024 Bytes
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 | import sys
from huggingface_hub import HfApi, create_repo
repo_id = "Ypeng12/quant-ai"
print(f"Creating Space repository '{repo_id}' on Hugging Face...")
api = HfApi()
try:
url = create_repo(
repo_id=repo_id,
repo_type="space",
space_sdk="static",
private=False,
exist_ok=True
)
print(f"Space repository ready at: {url}")
except Exception as e:
print(f"Repo creation notice: {e}")
print("Uploading project files to Hugging Face Space...")
api.upload_folder(
folder_path="c:/Users/pengy/OneDrive/Desktop/Quont",
repo_id=repo_id,
repo_type="space",
ignore_patterns=[
"*.pyc",
"__pycache__/*",
"**/__pycache__/*",
".git/*",
"**/.git/*",
".venv/*",
"**/.venv/*",
"node_modules/*",
"**/node_modules/*",
"scratch/*",
"*.pdf",
".gemini/*"
]
)
print("✅ Upload completed successfully!")
print(f"Space live URL: https://huggingface.co/spaces/{repo_id}")
|