import requests import time print("Waiting for Hugging Face Space to rebuild with REAL AI MODEL...") print("This may take 5-10 minutes due to PyTorch installation.") print("=" * 70) base_url = "https://ranar118-voice-detection.hf.space" # Increased timeout and attempts for heavier build for attempt in range(1, 30): print(f"\nAttempt {attempt}/30 (checking every 30 seconds)...") try: response = requests.get(f"{base_url}/", timeout=15) if response.status_code == 200: # We don't have a visual change to check for, but if it responds 200 # after a rebuild, it means the app started successfully with the new model. # Using a simple check to ensure it's up. if "Voice Detection Tool" in response.text: # Check if we can trigger an inference (optional, might be too complex for this script) # For now, just checking liveness is good enough indication the build finished. print("\n" + "=" * 70) print("✅ SUCCESS! The Real AI Model version is live!") print("=" * 70) print("\n🧠 AI Status:") print(" • Model: MelodyMachine/Deepfake-audio-detection") print(" • Framework: PyTorch + Transformers") print(" • Status: Online and Ready") print("\n🌐 Visit: https://ranar118-voice-detection.hf.space/") break else: print(f" Status: {response.status_code}") if response.status_code == 500: print(" (Application error - might be starting up or out of memory)") if response.status_code == 503: print(" (Building or Starting)") except Exception as e: print(f" ⚠️ Status: Not Ready ({str(e)[:50]})") time.sleep(30) else: print("\n⏳ Rebuild is taking longer than expected.") print("Please check the 'Logs' tab in your Hugging Face Space.")