Spaces:
Sleeping
Sleeping
File size: 789 Bytes
70ea7be | 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 | """Custom exception classes for the AI Services V2 layer."""
class DatasetError(Exception):
"""Raised when dataset operations fail (missing file, schema mismatch)."""
class TrainingError(Exception):
"""Raised when a model training pipeline fails.
Attributes:
model_name: The name of the model whose training failed.
message: Human-readable description of the failure.
"""
def __init__(self, message: str, model_name: str) -> None:
self.model_name = model_name
super().__init__(f"[{model_name}] {message}")
class ModelNotLoadedError(Exception):
"""Raised when inference is attempted on an unloaded model."""
class EntityNotFoundError(Exception):
"""Raised when a referenced entity (student, LO, class) doesn't exist."""
|