From f52994e8caf42d62fd84b00021c1212a06a1c4d5 Mon Sep 17 00:00:00 2001 From: Mert <101130780+mertalev@users.noreply.github.com> Date: Sun, 28 Jan 2024 15:54:33 -0500 Subject: [PATCH] fix(ml): model paths not working (#6705) * fix str enum string repr * fixed typing --- machine-learning/app/schemas.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/machine-learning/app/schemas.py b/machine-learning/app/schemas.py index f9e64bd259..e2a027e1b8 100644 --- a/machine-learning/app/schemas.py +++ b/machine-learning/app/schemas.py @@ -6,6 +6,13 @@ import numpy.typing as npt from pydantic import BaseModel +class StrEnum(str, Enum): + value: str + + def __str__(self) -> str: + return self.value + + class TextResponse(BaseModel): __root__: str @@ -21,12 +28,12 @@ class BoundingBox(TypedDict): y2: int -class ModelType(str, Enum): +class ModelType(StrEnum): CLIP = "clip" FACIAL_RECOGNITION = "facial-recognition" -class ModelRuntime(str, Enum): +class ModelRuntime(StrEnum): ONNX = "onnx" ARMNN = "armnn"