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") # Save the token to the Hugging Face folder HfFolder.save_token(access_token) # Authenticate HfFolder.get_token() # Create a new repository create_repo("image-search-engine-fashion", private=False) # 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" )