fix(ml): better model unloading (#3340)

* restart process on inactivity

* formatting

* always update `last_called`

* load models sequentially

* renamed variable, updated docs

* formatting

* made poll env name consistent with model ttl env
This commit is contained in:
Mert
2023-11-16 21:42:44 -05:00
committed by GitHub
parent 98f87c6548
commit a6af4892e3
3 changed files with 42 additions and 11 deletions

View File

@ -13,7 +13,8 @@ from .schemas import ModelType
class Settings(BaseSettings):
cache_folder: str = "/cache"
model_ttl: int = 0
model_ttl: int = 300
model_ttl_poll_s: int = 10
host: str = "0.0.0.0"
port: int = 3003
workers: int = 1