when I use AsyncInferenceClient,sometimes I recived 500 500 Internal Server Error like this:
aiohttp.client_exceptions.ClientResponseError: 500, message='', url='/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2FShakker-Labs%2FFLUX.1-dev-LoRA-One-Click-Creative-Template' .
My code just like this:
from huggingface_hub import AsyncInferenceClient
API_URL = "/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2FShakker-Labs%2FFLUX.1-dev-LoRA-One-Click-Creative-Template"
headers = {
"Authorization": "Bearer hf_xxxxxxx",
"x-use-cache": "false"
}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.content
image_bytes = query({
"inputs": "Astronaut riding a horse",
"parameters": {
"width": 512,
"height": 512
}
})
print(image_bytes)