import os from huggingface_hub import HfApi def main(): token = os.getenv("HF_TOKEN") if not token: raise ValueError( "HF_TOKEN environment variable not set. Please export it before running." ) api = HfApi(token=token) # Your repository details repo_id = "albidar-solutions/combilatent" repo_type = "model" print(f"Creating/verifying repository: {repo_id}...") api.create_repo(repo_id=repo_id, repo_type=repo_type, exist_ok=True) # Define files/folders to strictly ignore ignore_list = [ # "hf_upload.py", ".git/", "__pycache__/", "*.log", ".DS_Store", ] print(f"Starting large folder upload of the current directory to HF...") # Using the optimized large folder method api.upload_large_folder( folder_path=".", # Current directory repo_id=repo_id, repo_type=repo_type, ignore_patterns=ignore_list, ) print("Upload complete! Everything was pushed successfully.") if __name__ == "__main__": main()