mirror of
https://github.com/immich-app/immich.git
synced 2025-07-19 22:44:24 +02:00
fix(ml): load models in separate threads (#4034)
* load models in thread * set clip mode logs to debug level * updated tests * made fixtures slightly less ugly * moved responses to json file * formatting
This commit is contained in:
parent
f1db257628
commit
258b98c262
9 changed files with 1683 additions and 114 deletions
machine-learning/app
|
@ -1,4 +1,5 @@
|
|||
from typing import Iterator, TypeAlias
|
||||
import json
|
||||
from typing import Any, Iterator, TypeAlias
|
||||
from unittest import mock
|
||||
|
||||
import numpy as np
|
||||
|
@ -31,3 +32,8 @@ def mock_get_model() -> Iterator[mock.Mock]:
|
|||
def deployed_app() -> TestClient:
|
||||
init_state()
|
||||
return TestClient(app)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def responses() -> dict[str, Any]:
|
||||
return json.load(open("responses.json", "r"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue