Spaces:
Configuration error
Configuration error
Create model.py
Browse files
model.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#endpointe ait model
|
2 |
+
import requests
|
3 |
+
from config import HUGGINGFACE_API_URL, HUGGINGFACE_API_KEY
|
4 |
+
|
5 |
+
def get_huggingface_prediction(input_data): #input_data'yı main.py ile entegre etmeliyim
|
6 |
+
headers = {
|
7 |
+
"Authorization": f"Bearer {HUGGINGFACE_API_KEY}"
|
8 |
+
}
|
9 |
+
payload = {
|
10 |
+
"inputs": input_data
|
11 |
+
}
|
12 |
+
|
13 |
+
response = requests.post(HUGGINGFACE_API_URL, headers=headers, json=payload)
|
14 |
+
return response.json()
|