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