update save method in pipeline

This commit is contained in:
root
2024-07-15 11:21:52 +08:00
parent aa8581cd11
commit f032564a43
2 changed files with 35 additions and 18 deletions

View File

@@ -33,11 +33,16 @@ class StatefulBaseClass:
return state
def show_config(self):
def show_config(self, registered_objects=None):
if registered_objects is None: # root call
registered_objects = []
config = {}
for key, value in self.__dict__.items():
if isinstance(value, StatefulBaseClass):
config[str(key)] = value.show_config()
if isinstance(value, StatefulBaseClass) and value not in registered_objects:
registered_objects.append(value)
config[str(key)] = value.show_config(registered_objects)
else:
config[str(key)] = str(value)
return config