Spaces:
Configuration error

chat / model.py
yonkasoft's picture
Create model.py
10d6a91 verified
raw
history blame
428 Bytes
#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()