We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f00d05 commit e5ae3a5Copy full SHA for e5ae3a5
autointent/_dump_tools.py
@@ -6,6 +6,7 @@
6
import joblib
7
import numpy as np
8
import numpy.typing as npt
9
+from pydantic import BaseModel
10
from sklearn.base import BaseEstimator
11
12
from autointent import Embedder, Ranker, VectorIndex
@@ -65,6 +66,8 @@ def dump(obj: Any, path: Path) -> None: # noqa: ANN401
65
66
joblib.dump(val, path / Dumper.estimators / key)
67
elif isinstance(val, Ranker):
68
val.save(str(path / Dumper.cross_encoders / key))
69
+ elif isinstance(val, BaseModel):
70
+ simple_attrs[f"base_model_{key}"] = val.model_dump()
71
else:
72
msg = f"Attribute {key} of type {type(val)} cannot be dumped to file system."
73
logger.error(msg)
0 commit comments