File size: 664 Bytes
e418977
 
 
 
 
 
 
 
 
 
 
 
 
fda19f9
 
e418977
 
 
 
 
 
 
fda19f9
 
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
from dotenv import load_dotenv
import os
from huggingface_hub import HfApi, HfFolder, create_repo, upload_folder

# Load environment variables from .env file
load_dotenv()

# Load the access token from the environment variable
access_token = os.getenv("HF_ACCESS_TOKEN")

if access_token is None:
    raise ValueError("HF_ACCESS_TOKEN environment variable is not set")

#authenticate
hf_api=HfApi(token=access_token)

# Upload the folder
upload_folder(
    folder_path=r"C:\Users\rudra\Documents\GitHub\image-search-engine",
    repo_id="rudra0410/image-search-engine-fashion",
    repo_type="model",
    commit_message="Initial upload"
)