Spaces:
Sleeping
Sleeping
Update checks/endpoint_check.py
Browse files- checks/endpoint_check.py +1 -10
checks/endpoint_check.py
CHANGED
@@ -3,7 +3,7 @@ import sys
|
|
3 |
|
4 |
import requests
|
5 |
|
6 |
-
def
|
7 |
try:
|
8 |
# No Authorization header required for public models
|
9 |
response = requests.get(endpoint)
|
@@ -23,15 +23,6 @@ def is_huggingface_public_endpoint(endpoint: str):
|
|
23 |
print(f"Request failed: {e}")
|
24 |
return False
|
25 |
|
26 |
-
# Example usage:
|
27 |
-
# Replace with your public Hugging Face model's endpoint URL
|
28 |
-
endpoint = "https://api-inference.huggingface.co/models/gpt2" # Example public model URL
|
29 |
-
|
30 |
-
if is_huggingface_public_endpoint(endpoint):
|
31 |
-
print("This is a valid Hugging Face Inference Endpoint.")
|
32 |
-
else:
|
33 |
-
print("This is NOT a Hugging Face Inference Endpoint.")
|
34 |
-
|
35 |
|
36 |
|
37 |
def is_huggingface_endpoint(endpoint: str):
|
|
|
3 |
|
4 |
import requests
|
5 |
|
6 |
+
def is_public_endpoint(endpoint: str):
|
7 |
try:
|
8 |
# No Authorization header required for public models
|
9 |
response = requests.get(endpoint)
|
|
|
23 |
print(f"Request failed: {e}")
|
24 |
return False
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
|
28 |
def is_huggingface_endpoint(endpoint: str):
|