Skip to content

Commit

Permalink
fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle committed Nov 10, 2023
1 parent 9ed028f commit 2d4dc4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public TrainedModelConfig(StreamInput in) throws IOException {
} else {
platformArchitecture = null;
}
if (in.getTransportVersion().onOrAfter(TransportVersions.ML_PACKAGE_LOADER_PLATFORM_ADDED)) {
if (in.getTransportVersion().onOrAfter(TransportVersions.ML_TRAINED_MODEL_PREFIX_STRINGS_ADDED)) {
prefixStrings = in.readOptionalWriteable(TrainedModelPrefixStrings::new);
}
}
Expand Down Expand Up @@ -486,7 +486,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalString(platformArchitecture);
}

if (out.getTransportVersion().onOrAfter(TransportVersions.ML_PACKAGE_LOADER_PLATFORM_ADDED)) {
if (out.getTransportVersion().onOrAfter(TransportVersions.ML_TRAINED_MODEL_PREFIX_STRINGS_ADDED)) {
out.writeOptionalWriteable(prefixStrings);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ protected TrainedModelConfig mutateInstanceForVersion(TrainedModelConfig instanc
if (version.before(TransportVersions.ML_TRAINED_MODEL_CONFIG_PLATFORM_ADDED)) {
builder.setPlatformArchitecture(null);
}
if (version.before(TransportVersions.ML_TRAINED_MODEL_PREFIX_STRINGS_ADDED)) {
builder.setPrefixStrings(null);
}
return builder.build();
}
}

0 comments on commit 2d4dc4c

Please sign in to comment.