Getting HTTP Error Code: 422 when using Inference API

#96
by reetkat - opened

I'm trying to use inference API with falcon-40b and receiving: <Response [422]>
The error is not descriptive and its hard to debug. My code:

payload = {
    "inputs": '...',
    "parameters": {"temperature": "0.3"},
}
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {API_TOKEN}"}
API_URL = "https://..."

data = json.dumps(payload)
response = requests.request("POST", API_URL, headers=headers, data=data)
print(response)

What is the content of print(response.text) ?

It turned out that the issue was due to the parameters themselves. Even though the documentation says: "temperature", the inference endpoints accept the parameter as "Temperature" with a capital T.

Sign up or log in to comment