Skip to content

Commit

Permalink
[wlm] Trim whitespce for model_id (deepjavalibrary#2175)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu authored Jul 15, 2024
1 parent 1a6eb75 commit 4a77c76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wlm/src/main/java/ai/djl/serving/wlm/ModelInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ private String inferEngine() throws ModelException {

String modelId = prop.getProperty("option.model_id");
if (modelId != null && modelId.startsWith("djl://")) {
Repository repo = Repository.newInstance("tmp", modelId);
Repository repo = Repository.newInstance("tmp", modelId.trim());
MRL mrl = repo.getResources().get(0);
String groupId = mrl.getGroupId();
ModelZoo zoo = ModelZoo.getModelZoo(groupId);
Expand Down Expand Up @@ -1112,10 +1112,10 @@ void downloadS3() throws ModelException, IOException {
return;
}
if (modelId.startsWith("s3://")) {
this.downloadDir = downloadS3ToDownloadDir(modelId);
this.downloadDir = downloadS3ToDownloadDir(modelId.trim());
} else if (modelId.startsWith("djl://")) {
logger.info("{}: djl model zoo url found: {}", uid, modelId);
modelUrl = modelId;
modelUrl = modelId.trim();
// download real model from model zoo
downloadModel();
}
Expand Down

0 comments on commit 4a77c76

Please sign in to comment.