Refactor by adding context
Signed-off-by: András Schmelczer <andras@schmelczer.dev>
This commit is contained in:
parent
83e1a673cf
commit
a03e78bb73
1 changed files with 134 additions and 100 deletions
|
|
@ -4,17 +4,16 @@ from typing import Optional, Union
|
|||
|
||||
from joblib import dump
|
||||
|
||||
from good_ai.good_ai.context.get_context import get_context
|
||||
from good_ai.open_s3 import LargeFile
|
||||
|
||||
from ..set_default_config import set_default_config_if_uninitialized
|
||||
|
||||
logger = logging.getLogger("models")
|
||||
|
||||
|
||||
def save_model(
|
||||
model: Union[Path, str, object], key: str, keep_last_n: Optional[int] = None
|
||||
) -> int:
|
||||
set_default_config_if_uninitialized()
|
||||
get_context() # will setup LargeFile if there was no config set
|
||||
|
||||
file = LargeFile(name=key, mode="wb", keep_last_n=keep_last_n)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue