Spaces:
Sleeping
Sleeping
File size: 1,154 Bytes
62f828b |
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 |
class ModelLoadError(Exception):
"""Raised when the model fails to load."""
def __init__(self, message="Failed to load the model."):
self.message = message
super().__init__(self.message)
class PreprocessingError(Exception):
"""Raised when an error occurs during preprocessing."""
def __init__(self, message="Error during image preprocessing."):
self.message = message
super().__init__(self.message)
class PostprocessingError(Exception):
"""Raised when an error occurs during postprocessing."""
def __init__(self, message="Error during image postprocessing."):
self.message = message
super().__init__(self.message)
class InferenceError(Exception):
"""Raised when an error occurs during inference."""
def __init__(self, message="Error during inference."):
self.message = message
super().__init__(self.message)
class InputError(Exception):
"""Raised when an error occurs during loading input."""
def __init__(self, message="Error loading input."):
self.message = message
super().__init__(self.message) |