import os from huggingface_hub import HfApi # 1. Configuration repo_id = "SushCodex/Hugging_face_Openenv" token = os.getenv("HF_TOKEN") # Or paste your token here string: "your_token" if not token: token = input("Please enter your Hugging Face Write Token: ") api = HfApi() print(f"šŸš€ Uploading Folder to Space: {repo_id}...") try: api.upload_folder( folder_path=".", # Upload current directory repo_id=repo_id, repo_type="space", token=token, path_in_repo=".", ignore_patterns=[".git", ".pyc", "__pycache__"] # Skip git and cache ) print("\nāœ… SUCCESS: Your OpenEnv project is now live on Hugging Face Spaces!") print(f"šŸ”— View it here: https://huggingface.co/spaces/{repo_id}") except Exception as e: print(f"\nāŒ UPLOAD FAILED: {e}") print("\nTip: Ensure your token has 'WRITE' permissions.")