CSGO-Map-Definer / inference-api.py
TrainThenObtain-ai's picture
Update inference-api.py
6748661
raw
history blame contribute delete
434 Bytes
import json
import requests
headers = {"Authorization": "Bearer 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"}
API_URL = "/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2FTranThenObtain-ai%2FCSGO-Map-Definer%26quot%3B%3C%2Fspan%3E%3C!-- HTML_TAG_END -->
def query(filename):
with open(filename, "rb") as f:
data = f.read()
response = requests.request("POST", API_URL, headers=headers, data=data)
return json.loads(response.content.decode("utf-8"))
data = query("dust2.jpg")