Skip to content

Serialize output for lifecycle hooks without SaveTrainParameters#40

Merged
Theauxm merged 1 commit intomainfrom
fix/serialize-output-for-lifecycle-hooks
Mar 20, 2026
Merged

Serialize output for lifecycle hooks without SaveTrainParameters#40
Theauxm merged 1 commit intomainfrom
fix/serialize-output-for-lifecycle-hooks

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented Mar 20, 2026

Summary

  • When SaveTrainParameters() is not configured, Metadata.Output was null during OnCompleted hooks
  • Now serializes the output object to JSON after SaveChanges but before firing lifecycle hooks
  • This runs after persistence so the serialized value is not written to the database — it's only available in-memory for hook consumers

Test plan

  • Run_WithoutSaveTrainParameters_OnCompletedHasSerializedOutput — verifies Output is populated
  • Run_WithoutSaveTrainParameters_OutputContainsCorrectData — verifies deserialized content matches
  • Run_WithoutSaveTrainParameters_GetOutputObjectStillAvailable — verifies GetOutputObject() still works

When SaveTrainParameters() is not configured, Metadata.Output was null
during OnCompleted hooks. Now serializes the output object to JSON after
SaveChanges but before firing lifecycle hooks, so hook consumers can
read Metadata.Output without requiring the parameter provider.
@Theauxm Theauxm merged commit f9088c9 into main Mar 20, 2026
1 check passed
@Theauxm Theauxm deleted the fix/serialize-output-for-lifecycle-hooks branch March 20, 2026 20:05
@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented Mar 20, 2026

This PR is included in version 1.24.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant