Spaces:
Configuration error

yonkasoft commited on
Commit
10d6a91
1 Parent(s): 8225082

Create model.py

Browse files
Files changed (1) hide show
  1. model.py +14 -0
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()