Spaces:
Runtime error
Runtime error
Download error_map.py from MGLDZM/chgpt: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/MGLDZM/chgpt/resolve/main/error_map.py
- Command line
-
hf download hf://spaces/MGLDZM/chgpt/error_map.py
-
curl -L -o error_map.py https://huggingface.co/spaces/MGLDZM/chgpt/resolve/main/error_map.py
1.16 kB
| from openai import error as openai_error | |
| from fastapi import status | |
| import requests | |
| error_table = { | |
| requests.exceptions.RequestException: { | |
| "status_code": status.HTTP_408_REQUEST_TIMEOUT, | |
| "detail": "Los servidores tardaron mucho en responder, puede haber sobrecarga en OpenAI, reintenta luego (error 1)" | |
| }, | |
| openai_error.APIConnectionError: { | |
| "status_code": status.HTTP_408_REQUEST_TIMEOUT, | |
| "detail": "El servidor no respondi贸, hubo un error de API" | |
| }, | |
| openai_error.Timeout: { | |
| "status_code": status.HTTP_408_REQUEST_TIMEOUT, | |
| "detail": "El servidor tard贸 demasiado en responder" | |
| }, | |
| openai_error.InvalidRequestError: { | |
| "status_code": status.HTTP_408_REQUEST_TIMEOUT, | |
| "detail": "ChatGPT se gomit贸 馃ぎ, este chat ya es muy largo, limpia el chat y reintenta." | |
| }, | |
| openai.RateLimitError: { | |
| "status_code": status.HTTP_408_REQUEST_TIMEOUT, | |
| "detail": "ChatGPT no quiere responder 馃槱 ellos dicen que lo usamos mucho." | |
| } | |
| "undefined": { | |
| "status_code": status.HTTP_408_REQUEST_TIMEOUT, | |
| "detail": "Error no definido 馃檮" | |
| } | |
| } | |