ktongue/docker_container / SGAE /upload_to_space.py
download
raw
841 Bytes
from huggingface_hub import HfApi
import os
api = HfApi(token="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")
repo_id = "ktongue/sgae-app"
repo_type = "space"
# Files to upload (local_path -> repo_path)
files = [
("Dockerfile", "Dockerfile"),
("entrypoint.sh", "entrypoint.sh"),
("apache-laravel.conf", "apache-laravel.conf"),
(".dockerignore", ".dockerignore"),
(".env", ".env"),
]
print("Uploading files to Space...")
for local_path, repo_path in files:
full_path = os.path.join("/root/SGAE", local_path)
print(f" Uploading {repo_path}...")
api.upload_file(
path_or_fileobj=full_path,
path_in_repo=repo_path,
repo_id=repo_id,
repo_type=repo_type,
commit_message=f"Update {repo_path}",
)
print(f" Done: {repo_path}")
print("\nAll files uploaded successfully!")

Xet Storage Details

Size:
841 Bytes
·
Xet hash:
c98d3838ebda3617df760ea6e48688dd40c3d4523b1b24a1188b67d05d360898

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.