Download inference-api.py from TrainThenObtain-ai/CSGO-Map-Definer: direct link, hf CLI and curl.
- Browser
- Download file 434 Bytes
-
https://huggingface.co/TrainThenObtain-ai/CSGO-Map-Definer/resolve/main/inference-api.py
- Command line
-
hf download hf://TrainThenObtain-ai/CSGO-Map-Definer/inference-api.py
-
curl -L -o inference-api.py https://huggingface.co/TrainThenObtain-ai/CSGO-Map-Definer/resolve/main/inference-api.py
434 Bytes
| import json | |
| import requests | |
| headers = {"Authorization": "Bearer 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"} | |
| API_URL = "https://api-inference.huggingface.co/models/TranThenObtain-ai/CSGO-Map-Definer" | |
| 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") |