File size: 704 Bytes
ea2504d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
"""Contains all custom errors."""
from requests import HTTPError
# INFERENCE CLIENT ERRORS
class InferenceTimeoutError(HTTPError, TimeoutError):
"""Error raised when a model is unavailable or the request times out."""
# TEXT GENERATION ERRORS
class TextGenerationError(HTTPError):
"""Generic error raised if text-generation went wrong."""
# Text Generation Inference Errors
class ValidationError(TextGenerationError):
"""Server-side validation error."""
class GenerationError(TextGenerationError):
pass
class OverloadedError(TextGenerationError):
pass
class IncompleteGenerationError(TextGenerationError):
pass
class UnknownError(TextGenerationError):
pass
|