Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """ | |
| Force HuggingFace Space rebuild and start training | |
| """ | |
| from huggingface_hub import HfApi, SpaceHardware | |
| import time | |
| import sys | |
| api = HfApi() | |
| space_id = "MSherbinii/ipad-vad-training" | |
| print("π Restarting Space to load bugfix...") | |
| try: | |
| # Restart the Space | |
| api.restart_space(repo_id=space_id) | |
| print("β Space restart triggered!") | |
| print("β³ Waiting 120 seconds for rebuild...") | |
| # Wait for rebuild | |
| for i in range(120, 0, -10): | |
| print(f" {i} seconds remaining...") | |
| time.sleep(10) | |
| print("\nβ Space should be rebuilt now!") | |
| print(f"π Go to: https://huggingface.co/spaces/{space_id}") | |
| print(" Click 'Quick Test' tab β 'Start Training'") | |
| except Exception as e: | |
| print(f"β API restart failed: {e}") | |
| print("\nManual restart required:") | |
| print(f"1. Visit: https://huggingface.co/spaces/{space_id}") | |
| print("2. Click 'β―' β 'Factory Restart'") | |
| print("3. Wait 2 minutes") | |
| print("4. Use 'Quick Test' tab") | |
| sys.exit(1) | |