Skip to content

Commit

Permalink
Fix(serializer): skip building callbacks that are already instantiated (
Browse files Browse the repository at this point in the history
#1390)

* Fix(serializer): skip building callbacks that are already instantiated

* Fix(serializer): formatting

* Do not serializer.load_params_from_definition in sk_params

* Fix tests

* Fix trivy scan script

* Revert "Fix tests"

This reverts commit dbd0a60.

* Revert "Do not serializer.load_params_from_definition in sk_params"

This reverts commit 65c290c.

* Revert "Fix trivy scan script"

This reverts commit bd0f4fe.

---------

Co-authored-by: Serhii Koropets <[email protected]>
  • Loading branch information
RollerKnobster and koropets authored Jul 2, 2024
1 parent 03a29b1 commit 3eca464
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gordo/serializer/from_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import typing # noqa

from typing import Union, Dict, Any, Iterable

from keras.src.callbacks import Callback
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.base import BaseEstimator
from tensorflow.keras import Sequential
Expand Down Expand Up @@ -365,5 +367,7 @@ def build_callbacks(definitions: list):
"""
callbacks = []
for callback in definitions:
callbacks.append(_build_step(callback))
callbacks.append(
callback if isinstance(callback, Callback) else _build_step(callback)
)
return callbacks

0 comments on commit 3eca464

Please sign in to comment.