Skip to content

Commit

Permalink
[docs] Updates offline mode document (#1596)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu authored Mar 5, 2024
1 parent a8a0b70 commit 09431ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ configure(javaProjects()) {
systemProperty "org.slf4j.simpleLogger.log.io.netty", "warn"
systemProperty "disableProgressBar", "true"
if (gradle.startParameter.offline) {
systemProperty "offline", "true"
systemProperty "ai.djl.offline", "true"
}
// This is used to avoid overriding on default engine for modules:
// mxnet-engine, mxnet-model-zoo, api (MockEngine), basicdataset, fasttext, etc
Expand Down
5 changes: 3 additions & 2 deletions engines/python/src/main/java/ai/djl/python/engine/PyEnv.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,15 @@ public synchronized void installDependency(Path modelDir) {
cmd.add("-r");
cmd.add(file.toAbsolutePath().toString());
Path dir = modelDir.resolve("requirements");
boolean offline = Utils.isOfflineMode();
if (Files.isDirectory(dir)) {
if (Boolean.getBoolean("offline")) {
if (offline) {
// if folder exists, we assume user want to resolve dependencies in the folder
cmd.add("--no-index");
}
cmd.add("-f");
cmd.add(dir.toAbsolutePath().toString());
} else if (Boolean.getBoolean("offline")) {
} else if (offline) {
cmd.add("--no-deps");
}

Expand Down
3 changes: 2 additions & 1 deletion serving/docs/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ DJLServing build on top of Deep Java Library (DJL). Here is a list of settings f
| ENGINE_CACHE_DIR | env var/system prop | The cache directory for engine native libraries: default: $DJL_CACHE_DIR |
| ai.djl.dataiterator.autoclose | system prop | Automatically close data set iterator, default: true |
| ai.djl.repository.zoo.location | system prop | global model zoo search locations, not recommended |
| offline | system prop | Don't access network for downloading engine's native library and model zoo metadata |
| DJL_OFFLINE | env var | Don't access network for downloading engine's native library and model zoo metadata |
| ai.djl.offline | system prop | Don't access network for downloading engine's native library and model zoo metadata |
| collect-memory | system prop | Enable memory metric collection, default: false |
| disableProgressBar | system prop | Disable progress bar, default: false |

Expand Down

0 comments on commit 09431ea

Please sign in to comment.