Skip to content

Commit

Permalink
torchserve version updated with server metadata.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrews Arokiam <andrews.arokiam@ideas2it.com>
  • Loading branch information
andyi2it committed Nov 16, 2023
1 parent a3c29b1 commit 19f6ab2
Showing 1 changed file with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ public void handleRequest(
// For fetch server metadata
JsonArray supportedExtensions = new JsonArray();
JsonObject response = new JsonObject();
String tsVersion = ConfigManager.getInstance().getVersion();
response.addProperty("name", "Torchserve");
response.addProperty("version", getTsVersion());
response.addProperty("version", tsVersion);
supportedExtensions.add("kserve");
supportedExtensions.add("kubeflow");
response.add("extenstion", supportedExtensions);
Expand All @@ -108,18 +109,4 @@ public void handleRequest(
chain.handleRequest(ctx, req, decoder, segments);
}
}

private String getTsVersion() {
String tsVersion = "";
try {
BufferedReader reader = new BufferedReader(new FileReader(TS_VERSION_FILE_PATH));
String version = reader.readLine();
reader.close();
return version;
} catch (IOException e) {
e.printStackTrace();
}
return tsVersion;

}
}

0 comments on commit 19f6ab2

Please sign in to comment.