Spaces:
Sleeping
Sleeping
File size: 1,027 Bytes
d1df841 bc6e9f5 d1df841 bc6e9f5 |
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 |
import os
from huggingface_hub import HfApi
from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parent.parent
api = HfApi()
print("Uploading data.....")
api.upload_folder(
folder_path=str(PROJECT_ROOT / "data"),
repo_id="satishjasthij/PicMatch",
repo_type="space",
token=os.getenv("HUGGINGFACE_TOKEN"),
commit_message="add dataset",
create_pr=True,
)
print("Finished uploading data")
print("Uploading databases.....")
print("Uploading milvus.db")
api.upload_file(
path_or_fileobj=str(PROJECT_ROOT / "milvus.db"),
path_in_repo="milvus.db",
repo_id="satishjasthij/PicMatch",
repo_type="space",
token=os.getenv("HUGGINGFACE_TOKEN"),
)
print("Finished uploading milvus.db")
print("Uploading image_tracker.db")
api.upload_file(
path_or_fileobj=str(PROJECT_ROOT / "image_tracker.db"),
path_in_repo="image_tracker.db",
repo_id="satishjasthij/PicMatch",
repo_type="space",
token=os.getenv("HUGGINGFACE_TOKEN"),
)
print("Finished uploading image_tracker.db") |