Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add model_uuid to Java Model #5165

Merged
merged 8 commits into from Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -41,6 +41,9 @@ public static class Signature {
@JsonProperty("input_example")
private Map<String, Object> input_example;

@JsonProperty("model_uuid")
private String modelUuid;

private String rootPath;

/**
Expand Down Expand Up @@ -82,6 +85,11 @@ public Optional<String> getRunId() {
return Optional.ofNullable(this.runId);
}

/** @return The MLflow model's uuid */
public Optional<String> getModelUuid() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: <4 Acronym naming convention in Java typically preserves the upper case acronym, particularly if the std library preserves.

public Optional<String> getModelUUID() {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BenWilson2 Can we use getModelUuid since we already have getRunUuid?

return Optional.ofNullable(this.modelUuid);
}

/** @return The path to the root directory of the MLflow model */
public Optional<String> getRootPath() {
return Optional.ofNullable(this.rootPath);
Expand Down
Expand Up @@ -17,6 +17,7 @@ public void testModelIsLoadedFromYamlUsingConfigPathCorrectly() {
Model model = Model.fromConfigPath(configPath);
Assert.assertTrue(model.getFlavor(MLeapFlavor.FLAVOR_NAME, MLeapFlavor.class).isPresent());
Assert.assertTrue(model.getUtcTimeCreated().isPresent());
Assert.assertTrue(model.getModelUuid().isPresent());
} catch (IOException e) {
e.printStackTrace();
Assert.fail("Encountered an exception while reading the model from a configuration path!");
Expand Down
2 changes: 0 additions & 2 deletions mlflow/mleap.py
Expand Up @@ -182,8 +182,6 @@ def save_model(
model. The given example will be converted to a Pandas DataFrame and then
serialized to json using the Pandas split-oriented format. Bytes are
base64-encoded.


"""
if mlflow_model is None:
mlflow_model = Model()
Expand Down