feat(ml): configurable batch size for facial recognition (#13689)

* configurable batch size, default openvino to 1

* update docs

* don't add a new dependency for two lines

* fix typing
This commit is contained in:
Mert 2024-10-23 08:50:28 -04:00 committed by GitHub
parent a76c39812f
commit 1ec9a60e41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 70 additions and 31 deletions

View file

@ -19,6 +19,10 @@ class PreloadModelData(BaseModel):
facial_recognition: str | None = None
class MaxBatchSize(BaseModel):
facial_recognition: int | None = None
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_prefix="MACHINE_LEARNING_",
@ -41,6 +45,7 @@ class Settings(BaseSettings):
ann_fp16_turbo: bool = False
ann_tuning_level: int = 2
preload: PreloadModelData | None = None
max_batch_size: MaxBatchSize | None = None
@property
def device_id(self) -> str: