import requests API_URL = "https://api-inference.huggingface.co/models/rizvandwiki/gender-classification-2" headers = {"Authorization": "Bearer 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"} def query(filename): with open(filename, "rb") as f: data = f.read() response = requests.post(API_URL, headers=headers, data=data) return response.json() output = query("test.jpg") print(output)