yetessam commited on
Commit
5e76135
·
verified ·
1 Parent(s): 06e3381

Removing duplicate

Browse files
Files changed (1) hide show
  1. check_endpoint.py +0 -37
check_endpoint.py DELETED
@@ -1,37 +0,0 @@
1
- import os
2
- import requests
3
-
4
-
5
- def is_huggingface_endpoint(endpoint):
6
- if not endpoint:
7
- return False
8
-
9
- try:
10
- # Send a simple GET or POST request to the endpoint
11
- headers = {"Authorization": "Bearer YOUR_HUGGINGFACE_API_KEY"} # Replace with your Hugging Face API key if needed
12
- response = requests.get(endpoint, headers=headers)
13
-
14
- if response.status_code == 200:
15
- # Check if the response contains Hugging Face-specific data
16
- if "model" in response.json():
17
- return True
18
- elif response.status_code == 404:
19
- print("Endpoint not found, make sure the endpoint is correct.")
20
- else:
21
- print(f"Error: Received status code {response.status_code}")
22
-
23
- return False
24
-
25
- except requests.exceptions.RequestException as e:
26
- print(f"Request failed: {e}")
27
- return False
28
-
29
- '''
30
- # Test the endpoint
31
-
32
- if is_huggingface_endpoint(my_id):
33
- print("This is a Hugging Face Inference Endpoint.")
34
- else:
35
- print("This is NOT a Hugging Face Inference Endpoint.")
36
-
37
- '''