455a5d112d
* Input format extended * Deleted redundant code * Added weights format to conv2d config * Refactoring * dl4j base test functionality * Different tests base class per module * Check base class for dl4j-graph subproject tests * Check if test classes extend BaseDL4JTest * Use nd4j-common-tests as transient dependency * Enums and tests added * Added codegenerated methods * Use namespace methods * Replace DifferentialFunctionFactory with codegenerated classes * Fixed linspace * Namespaces regenerated * Namespaces used instead of factory * Regenerated base classes * Input format extended * Added weights format to conv2d config * Refactoring * dl4j base test functionality * Different tests base class per module * Check base class for dl4j-graph subproject tests * Check if test classes extend BaseDL4JTest * Use nd4j-common-tests as transient dependency * Enums and tests added * Added codegenerated methods * Use namespace methods * Replace DifferentialFunctionFactory with codegenerated classes * Fixed linspace * Namespaces regenerated * Regenerated base classes * Regenerated namespaces * Generate nd4j namespaces * INDArrays accepting constructors * Generated some ops * Some fixes * SameDiff ops regenerated * Regenerated nd4j ops * externalErrors moved * Compilation fixes * SquaredDifference - strict number of args * Deprecated code cleanup. Proper base class for tests. * Extend test classes with BaseND4JTest * Extend test classes with BaseDL4JTest * Legacy code * DL4J cleanup * Exclude test utils from base class check * Tests fixed * Arbiter tests fix * Test dependency scope fix + pom.xml formatting Signed-off-by: Alex Black <blacka101@gmail.com> * Significant number of fixes Signed-off-by: Alex Black <blacka101@gmail.com> * Another round of fixes Signed-off-by: Alex Black <blacka101@gmail.com> * Another round of fixes Signed-off-by: Alex Black <blacka101@gmail.com> * Few additional fixes Signed-off-by: Alex Black <blacka101@gmail.com> * DataVec missing test scope dependencies Signed-off-by: Alex Black <blacka101@gmail.com> Co-authored-by: Alex Black <blacka101@gmail.com> |
||
---|---|---|
.. | ||
src | ||
README.md | ||
pom.xml |
README.md
SameDiff model serving
This modules provides JSON-based serving of SameDiff models
Example
First of all we'll create server instance. Most probably you'll do it in application that will be running in container
val server = SameDiffJsonModelServer.<String, Sentiment>builder()
.adapter(new StringToSentimentAdapter())
.model(mySameDiffModel)
.port(8080)
.serializer(new SentimentSerializer())
.deserializer(new StringDeserializer())
.build();
server.start();
server.join();
Now, presumably in some other container, we'll set up remote inference client:
val client = JsonRemoteInference.<String, Sentiment>builder()
.endpointAddress("http://youraddress:8080/v1/serving")
.serializer(new StringSerializer())
.deserializer(new SentimentDeserializer())
.build();
Sentiment result = client.predict(myText);
On top of that, there's async call available, for cases when you need to chain multiple requests to one or multiple remote model servers.
Future<Sentiment> result = client.predictAsync(myText);