Skip to content

Commit

Permalink
[Serving] Fix reference to nonexistent field (mlrun#5137)
Browse files Browse the repository at this point in the history
  • Loading branch information
gtopper authored Feb 14, 2024
1 parent 06b5477 commit c67c84a
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions mlrun/serving/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ def __init__(
url_prefix: str = None,
health_prefix: str = None,
feature_vector_uri: str = "",
impute_policy: dict = {},
impute_policy: dict = None,
**kwargs,
):
"""Model router with feature enrichment (from the feature store)
Expand Down Expand Up @@ -1156,13 +1156,17 @@ def __init__(
)

self.feature_vector_uri = feature_vector_uri
self.impute_policy = impute_policy
self.impute_policy = impute_policy or {}

self._feature_service = None

def post_init(self, mode="sync"):
from ..feature_store import get_feature_vector

super().post_init(mode)
self._feature_service = self.feature_vector.get_online_feature_service(
self._feature_service = get_feature_vector(
self.feature_vector_uri
).get_online_feature_service(
impute_policy=self.impute_policy,
)

Expand Down Expand Up @@ -1191,7 +1195,7 @@ def __init__(
executor_type: Union[ParallelRunnerModes, str] = ParallelRunnerModes.thread,
prediction_col_name: str = None,
feature_vector_uri: str = "",
impute_policy: dict = {},
impute_policy: dict = None,
**kwargs,
):
"""Voting Ensemble with feature enrichment (from the feature store)
Expand Down Expand Up @@ -1298,13 +1302,17 @@ def __init__(
)

self.feature_vector_uri = feature_vector_uri
self.impute_policy = impute_policy
self.impute_policy = impute_policy or {}

self._feature_service = None

def post_init(self, mode="sync"):
from ..feature_store import get_feature_vector

super().post_init(mode)
self._feature_service = self.feature_vector.get_online_feature_service(
self._feature_service = get_feature_vector(
self.feature_vector_uri
).get_online_feature_service(
impute_policy=self.impute_policy,
)

Expand Down

0 comments on commit c67c84a

Please sign in to comment.