mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
unnecessary model type
This commit is contained in:
parent
585d093baf
commit
49ff045df3
2 changed files with 1 additions and 8 deletions
|
|
@ -38,13 +38,7 @@ class ModelCache:
|
||||||
async def get(
|
async def get(
|
||||||
self, model_name: str, model_type: ModelType, model_task: ModelTask, **model_kwargs: Any
|
self, model_name: str, model_type: ModelType, model_task: ModelTask, **model_kwargs: Any
|
||||||
) -> InferenceModel:
|
) -> InferenceModel:
|
||||||
config_key = ""
|
key = f"{model_name}{model_type}{model_task}"
|
||||||
if model_type == ModelType.OCR and model_task == ModelTask.OCR:
|
|
||||||
orientation = model_kwargs.get("orientationClassifyEnabled", True)
|
|
||||||
unwarping = model_kwargs.get("unwarpingEnabled", True)
|
|
||||||
config_key = f"_o{orientation}_u{unwarping}"
|
|
||||||
|
|
||||||
key = f"{model_name}{model_type}{model_task}{config_key}"
|
|
||||||
|
|
||||||
async with OptimisticLock(self.cache, key) as lock:
|
async with OptimisticLock(self.cache, key) as lock:
|
||||||
model: InferenceModel | None = await self.cache.get(key)
|
model: InferenceModel | None = await self.cache.get(key)
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ class ModelType(StrEnum):
|
||||||
RECOGNITION = "recognition"
|
RECOGNITION = "recognition"
|
||||||
TEXTUAL = "textual"
|
TEXTUAL = "textual"
|
||||||
VISUAL = "visual"
|
VISUAL = "visual"
|
||||||
OCR = "ocr"
|
|
||||||
|
|
||||||
|
|
||||||
class ModelFormat(StrEnum):
|
class ModelFormat(StrEnum):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue