Spaces:
Sleeping
Sleeping
| import os | |
| from huggingface_hub import HfApi | |
| REPO_ID = "ubuntu593/strenger-chat" | |
| TOKEN = os.getenv("HF_TOKEN") | |
| api = HfApi(token=TOKEN) | |
| print("π Deploying to Hugging Face Space...") | |
| try: | |
| api.upload_folder( | |
| folder_path=".", | |
| repo_id=REPO_ID, | |
| repo_type="space", | |
| ignore_patterns=[ | |
| ".git", | |
| ".git/*", | |
| ".git/**", | |
| ".venv", | |
| "__pycache__", | |
| "*.pyc", | |
| "*.png", | |
| "*.jpg", | |
| "*.jpeg", | |
| "*.gif", | |
| "*.log", | |
| "*.exe", | |
| "*.msi", | |
| "deploy_now.py", | |
| ".env", | |
| "hf_token.txt", | |
| "test_*.py", | |
| "test_*.txt", | |
| ], | |
| commit_message="Full deployment" | |
| ) | |
| print("β SUCCESS! App is live at:") | |
| print(f" https://huggingface.co/spaces/{REPO_ID}") | |
| except Exception as e: | |
| print(f"β FAILED: {e}") | |