Repository: deepjavalibrary/djl
Pull request #1715 (2022-06-14 17:29:52)

Add serving to docs site


Patch:
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index dfbff184c..979496c54 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -44,7 +44,11 @@ jobs:
       - name: clone demos
         run: |
           cd docs
-          git clone https://github.com/aws-samples/djl-demo.git demos
+          git clone https://github.com/deepjavalibrary/djl-demo.git demos
+      - name: clone serving
+        run: |
+          cd docs
+          git clone https://github.com/deepjavalibrary/djl-serving.git serving
       - name: build docs
         run: |
           cd docs
diff --git a/docs/.gitignore b/docs/.gitignore
index cd3a6135e..81625f8f8 100644
--- a/docs/.gitignore
+++ b/docs/.gitignore
@@ -1,1 +1,2 @@
-demos
\ No newline at end of file
+demos
+serving
diff --git a/docs/development/troubleshooting.md b/docs/development/troubleshooting.md
index c884bed9b..453f09669 100644
--- a/docs/development/troubleshooting.md
+++ b/docs/development/troubleshooting.md
@@ -232,7 +232,7 @@ No X11 DISPLAY variable was set, but this program performed an operation which r
 java.awt.HeadlessException:
 ```
 
-Follow the [steps here](https://github.com/aws-samples/d2l-java/blob/master/documentation/troubleshoot.md) to resolve it.
+Follow the [steps here](https://github.com/deepjavalibrary/d2l-java/blob/master/documentation/troubleshoot.md) to resolve it.
 
 
 ## 10. JVM crash
diff --git a/docs/interactive_tool.md b/docs/interactive_tool.md
index 683b56d05..ed102fedc 100644
--- a/docs/interactive_tool.md
+++ b/docs/interactive_tool.md
@@ -5,18 +5,18 @@ Without additional setup, you can easily run the tool kits online and export the
 
 ## [Interactive JShell](https://djl.ai/website/demo.html#jshell)
 
-![terminal](https://raw.githubusercontent.com/aws-samples/djl-demo/master/web-demo/interactive-console/img/terminal.gif)
+![terminal](https://raw.githubusercontent.com/deepjavalibrary/djl-demo/master/web-demo/interactive-console/img/terminal.gif)
 
 Interactive JShell is a modified version of [JShell](https://docs.oracle.com/javase/9/jshell/introduction-jshell.htm#JSHEL-GUID-630F27C8-1195-4989-9F6B-2C51D46F52C8) equipped with DJL features.
 You can use the existing Java features as well as DJL classes.
 To test out some functions in DJL, use this JShell to try methods defined in the [Javadoc](https://javadoc.io/doc/ai.djl/api/latest/ai/djl/ndarray/NDArray.html).
 We created useful operators to use in your deep learning applications.
-For more information about this JShell, see the [Interactive JShell and Block Runner for DJL](https://github.com/aws-samples/djl-demo/tree/master/web-demo/interactive-console#jshell) demo.
+For more information about this JShell, see the [Interactive JShell and Block Runner for DJL](https://github.com/deepjavalibrary/djl-demo/tree/master/web-demo/interactive-console#jshell) demo.
 
 
 ## [Block Runner](https://djl.ai/website/demo.html#block-runner)
 
-![block runner](https://raw.githubusercontent.com/aws-samples/djl-demo/master/web-demo/interactive-console/img/blockrunner.gif)
+![block runner](https://raw.githubusercontent.com/deepjavalibrary/djl-demo/master/web-demo/interactive-console/img/blockrunner.gif)
 
 Block Runner is designed to be simple. 
 It allows you to run Java code line by line without worrying about the class structures. As shown in the gif, you can simply craft some code and click the “Run” button to run it online. 
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index 026ccb953..c54afb223 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -135,8 +135,18 @@ nav:
       - AWS S3 support: 'extensions/aws-ai/README.md'
       - fastText: 'extensions/fasttext/README.md'
       - Hadoop support: 'extensions/hadoop/README.md'
+      - Huggingface Tokenizers: 'extensions/tokenizers/README.md'
       - OpenCV: 'extensions/opencv/README.md'
       - SentencePiece: 'extensions/sentencepiece/README.md'
+      - Tablesaw: 'extensions/tablesaw/README.md'
+      - DJL Serving:
+          - 'docs/serving/README.md'
+          - 'docs/serving/serving/docs/workflows.md'
+          - 'docs/serving/serving/docs/configuration.md'
+          - 'docs/serving/serving/docs/inference_api.md'
+          - 'docs/serving/serving/docs/management_api.md'
+          - 'docs/serving/serving/docs/plugin_management.md'
+      - 'docs/serving/wlm/README.md'
   - Demos:
       - Demos: 'docs/demos/README.md'
       - AWS:
@@ -173,7 +183,7 @@ nav:
           - Footwear Classification: 'docs/demos/footwear_classification/README.md'
           - Live Object Detection: 'docs/demos/live-object-detection/README.md'
           - Pneumonia Detection: 'docs/demos/pneumonia-detection/README.md'
-          - MultiEngine on DJL: 'docs/demos/multi-engine/README.md'
+          - MultiEngine on DJL: 'docs/demos/development/multi-engine/README.md'
           - Interactive JShell and Block Runner for DJL: 'docs/demos/web-demo/interactive-console/README.md'
           - Malicious URL Detection: 'docs/demos/malicious-url-detector/README.md'
       - Extensions:
diff --git a/examples/README.md b/examples/README.md
index 9c5b293e1..b5c7a7c7e 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -1,7 +1,7 @@
 # Examples
 
 This module contains examples to demonstrate use of the Deep Java Library (DJL).
-You can find more examples from our [djl-demo github repo](https://github.com/aws-samples/djl-demo).
+You can find more examples from our [djl-demo github repo](https://github.com/deepjavalibrary/djl-demo).
 
 The following examples are included for training:
 
@@ -34,7 +34,7 @@ You may be able to find more translator examples in our engine specific model zo
 [PyTorch](https://github.com/deepjavalibrary/djl/tree/master/engines/pytorch/pytorch-model-zoo),
 and [TensorFlow](https://github.com/deepjavalibrary/djl/tree/master/engines/tensorflow/tensorflow-model-zoo).
 
-More examples and demos of applications featuring DJL are located in our [demo repository](https://github.com/aws-samples/djl-demo).
+More examples and demos of applications featuring DJL are located in our [demo repository](https://github.com/deepjavalibrary/djl-demo).
 
 ## Prerequisites
 
diff --git a/website/demo.html b/website/demo.html
index 2eb4b3d6f..ab93b7fa6 100644
--- a/website/demo.html
+++ b/website/demo.html
@@ -72,7 +72,7 @@
                     <h5 class="header col s12 light">Experience Java to solve your DL problem in a simple way.</h5>
                 </div>
                 <div class="row center">
-                    <a href="https://github.com/aws-samples/djl-demo"
+                    <a href="https://github.com/deepjavalibrary/djl-demo"
                     class="btn-large waves-effect waves-light light-blue accent-2">Checkout our Demos</a>
                     <a href="https://docs.djl.ai/docs/demos/index.html"
                     class="btn-large waves-effect waves-light light-blue accent-2">Documentation</a>
@@ -197,7 +197,7 @@
                         <h5 class="header col s12 light">Want to know more?</h5>
                     </div>
                     <div class="row center">
-                        <a href="https://github.com/aws-samples/djl-demo"
+                        <a href="https://github.com/deepjavalibrary/djl-demo"
                         class="btn-large waves-effect waves-light light-blue accent-2 pulse">Checkout our demo repository</a>
                     </div>
                     <div class="row center">


Test patch:
diff --git a/android/core/src/androidTest/java/ai/djl/android/core/ModelLoadingTest.java b/android/core/src/androidTest/java/ai/djl/android/core/ModelLoadingTest.java
new file mode 100644
index 000000000..1ae1b73a9
--- /dev/null
+++ b/android/core/src/androidTest/java/ai/djl/android/core/ModelLoadingTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
+ * with the License. A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0/
+ *
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+ * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+package ai.djl.android.core;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.IOException;
+
+import ai.djl.ModelException;
+import ai.djl.inference.Predictor;
+import ai.djl.modality.Classifications;
+import ai.djl.modality.cv.Image;
+import ai.djl.modality.cv.ImageFactory;
+import ai.djl.modality.cv.transform.ToTensor;
+import ai.djl.modality.cv.translator.ImageClassificationTranslator;
+import ai.djl.repository.zoo.Criteria;
+import ai.djl.repository.zoo.ModelZoo;
+import ai.djl.repository.zoo.ZooModel;
+import ai.djl.translate.TranslateException;
+
+/* Integration test to check if model and inference runs fine */
+public class ModelLoadingTest {
+
+    @Test
+    public void testModelLoading() throws IOException, ModelException, TranslateException {
+        ImageClassificationTranslator translator = ImageClassificationTranslator.builder()
+                .addTransform(new ToTensor())
+                .optFlag(Image.Flag.GRAYSCALE)
+                .optApplySoftmax(true)
+                .build();
+        Criteria<Image, Classifications> criteria =
+                Criteria.builder()
+                        .setTypes(Image.class, Classifications.class)
+                        .optModelUrls("https://djl-ai.s3.amazonaws.com/resources/demo/pytorch/doodle_mobilenet.zip")
+                        .optTranslator(translator)
+                        .build();
+        Image image = ImageFactory.getInstance().fromUrl("https://resources.djl.ai/images/0.png");
+        try (ZooModel<Image, Classifications> model = ModelZoo.loadModel(criteria);
+             Predictor<Image, Classifications> predictor = model.newPredictor()) {
+            Classifications result = predictor.predict(image);
+            Assert.assertEquals("dog", result.best().getClassName());
+        }
+    }
+}