Spaces:
Sleeping
Sleeping
Download scripts/verify_api_fixes.py from GodRad/rag_saas_system: direct link, hf CLI and curl.
- Browser
- Download file 711 Bytes
-
https://huggingface.co/spaces/GodRad/rag_saas_system/resolve/main/scripts/verify_api_fixes.py
- Command line
-
hf download hf://spaces/GodRad/rag_saas_system/scripts/verify_api_fixes.py
-
curl -L -o verify_api_fixes.py https://huggingface.co/spaces/GodRad/rag_saas_system/resolve/main/scripts/verify_api_fixes.py
711 Bytes
| import requests | |
| import json | |
| BASE_URL = "http://localhost:7860/v1" | |
| def test_metrics(): | |
| print("Checking metrics...") | |
| try: | |
| res = requests.get(f"{BASE_URL}/admin/") | |
| if res.status_code == 200: | |
| print(f"Initial Metrics: {res.json()}") | |
| else: | |
| print(f"Failed to get metrics: {res.status_code}") | |
| except Exception as e: | |
| print(f"Error: {e}") | |
| def test_health(): | |
| print("Checking health...") | |
| try: | |
| res = requests.get("http://localhost:7860/health") | |
| print(f"Health: {res.status_code}") | |
| except Exception as e: | |
| print(f"Error: {e}") | |
| if __name__ == "__main__": | |
| test_health() | |
| test_metrics() | |