Download quick_test.py from MON3EMPASHA/SmartArabicSpeechTherapy: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/MON3EMPASHA/SmartArabicSpeechTherapy/resolve/main/quick_test.py
- Command line
-
hf download hf://spaces/MON3EMPASHA/SmartArabicSpeechTherapy/quick_test.py
-
curl -L -o quick_test.py https://huggingface.co/spaces/MON3EMPASHA/SmartArabicSpeechTherapy/resolve/main/quick_test.py
1.02 kB
| """Quick test to verify AI service is functional""" | |
| import requests | |
| import sys | |
| def test_health(): | |
| """Test health endpoint""" | |
| try: | |
| response = requests.get("http://localhost:8000/health", timeout=5) | |
| if response.status_code == 200: | |
| data = response.json() | |
| print(f"✓ Health check passed: {data}") | |
| return True | |
| else: | |
| print(f"✗ Health check failed: {response.status_code}") | |
| return False | |
| except Exception as e: | |
| print(f"✗ Could not connect to AI service: {e}") | |
| return False | |
| def main(): | |
| print("=" * 50) | |
| print("Quick AI Service Test") | |
| print("=" * 50) | |
| if test_health(): | |
| print("\n✓ AI Service is running and responsive!") | |
| sys.exit(0) | |
| else: | |
| print("\n✗ AI Service is not responding") | |
| print("Make sure to start it with:") | |
| print(" uvicorn main:app --reload --host 0.0.0.0 --port 8000") | |
| sys.exit(1) | |
| if __name__ == "__main__": | |
| main() | |