Spaces:
Sleeping
Sleeping
Update checks/endpoint_check.py
Browse files- checks/endpoint_check.py +5 -5
checks/endpoint_check.py
CHANGED
@@ -16,13 +16,13 @@ def is_public_endpoint(endpoint: str):
|
|
16 |
if response.status_code == 200:
|
17 |
# Public models will return inference data without needing an API key
|
18 |
# Attempt to parse JSON response
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
|
23 |
-
|
24 |
if "model" in response_json or "error" in response_json:
|
25 |
-
|
26 |
else:
|
27 |
print("The response does not contain inference-related data.")
|
28 |
return False
|
|
|
16 |
if response.status_code == 200:
|
17 |
# Public models will return inference data without needing an API key
|
18 |
# Attempt to parse JSON response
|
19 |
+
response_json = response.json()
|
20 |
+
# Print the first few keys of the response JSON for debugging
|
21 |
+
print(f"Response JSON keys: {list(response_json.keys())[:5]}")
|
22 |
|
23 |
+
# Public models will return inference data without needing an API key
|
24 |
if "model" in response_json or "error" in response_json:
|
25 |
+
return True
|
26 |
else:
|
27 |
print("The response does not contain inference-related data.")
|
28 |
return False
|