Move files
This commit is contained in:
parent
b97b20ba88
commit
c046d64a98
16 changed files with 35 additions and 36 deletions
|
|
@ -6,6 +6,11 @@ from .function_metadata import FunctionMetadata
|
|||
from .health_check_response import HealthCheckResponse
|
||||
from .model import Model
|
||||
from .operators import operators
|
||||
from .outputs import (
|
||||
ClassificationOutput,
|
||||
MultiLabelClassificationOutput,
|
||||
RegressionOutput,
|
||||
)
|
||||
from .query import Query
|
||||
from .route_config import RouteConfig
|
||||
from .sort_by import SortBy
|
||||
|
|
|
|||
6
great_ai/views/hashable_base_model.py
Normal file
6
great_ai/views/hashable_base_model.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class HashableBaseModel(BaseModel):
|
||||
def __hash__(self) -> int:
|
||||
return hash((type(self),) + tuple(self.__dict__.values()))
|
||||
3
great_ai/views/outputs/__init__.py
Normal file
3
great_ai/views/outputs/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from .classification_output import ClassificationOutput
|
||||
from .multi_label_classification_output import MultiLabelClassificationOutput
|
||||
from .regression_output import RegressionOutput
|
||||
9
great_ai/views/outputs/classification_output.py
Normal file
9
great_ai/views/outputs/classification_output.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from typing import Any, Optional, Union
|
||||
|
||||
from ..hashable_base_model import HashableBaseModel
|
||||
|
||||
|
||||
class ClassificationOutput(HashableBaseModel):
|
||||
label: Union[str, int]
|
||||
confidence: float
|
||||
explanation: Optional[Any]
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
from typing import List
|
||||
|
||||
from ..hashable_base_model import HashableBaseModel
|
||||
from .classification_output import ClassificationOutput
|
||||
|
||||
|
||||
class MultiLabelClassificationOutput(HashableBaseModel):
|
||||
labels: List[ClassificationOutput] = []
|
||||
8
great_ai/views/outputs/regression_output.py
Normal file
8
great_ai/views/outputs/regression_output.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from typing import Any, Optional, Union
|
||||
|
||||
from ..hashable_base_model import HashableBaseModel
|
||||
|
||||
|
||||
class RegressionOutput(HashableBaseModel):
|
||||
value: Union[int, float]
|
||||
explanation: Optional[Any]
|
||||
1
great_ai/views/outputs/sequence_labeling_output.py
Normal file
1
great_ai/views/outputs/sequence_labeling_output.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
# todo
|
||||
|
|
@ -3,7 +3,7 @@ from typing import Any, Dict, Generic, List, Optional, TypeVar
|
|||
|
||||
from pydantic import Extra
|
||||
|
||||
from ..helper import HashableBaseModel
|
||||
from .hashable_base_model import HashableBaseModel
|
||||
from .model import Model
|
||||
|
||||
T = TypeVar("T")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue