Skip to content

Commit

Permalink
Refactored Identifiers (#3381)
Browse files Browse the repository at this point in the history
* Refactored Identifiers

---------

Co-authored-by: Frank Liu <frankfliu2000@gmail.com>
  • Loading branch information
congyuluo and frankfliu authored Aug 30, 2024
1 parent 687dca9 commit 61d2f3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public void testModelZoo() throws ModelException, IOException, TranslateExceptio
try (ZooModel<QAInput, String> model = criteria.loadModel();
Predictor<QAInput, String> predictor = model.newPredictor()) {
QAInput input = new QAInput(question, paragraph);
String res = predictor.predict(input);
Assert.assertEquals(res, "december 2004");
String result = predictor.predict(input);
Assert.assertEquals(result, "december 2004");
}
}

Expand Down Expand Up @@ -101,7 +101,7 @@ public void testFutureVersion() throws IOException {
}

@Test
public void testOffLine() {
public void testOffline() {
System.setProperty("DJL_CACHE_DIR", "build/cache");
System.setProperty("ai.djl.offline", "true");
try {
Expand Down
4 changes: 2 additions & 2 deletions model-zoo/src/main/java/ai/djl/basicmodelzoo/basic/Mlp.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public Mlp(int input, int output, int[] hidden) {
@SuppressWarnings("this-escape")
public Mlp(int input, int output, int[] hidden, Function<NDList, NDList> activation) {
add(Blocks.batchFlattenBlock(input));
for (int hiddenSize : hidden) {
add(Linear.builder().setUnits(hiddenSize).build());
for (int hiddenLayerSize : hidden) {
add(Linear.builder().setUnits(hiddenLayerSize).build());
add(activation);
}

Expand Down

0 comments on commit 61d2f3a

Please sign in to comment.