Skip to content

Commit

Permalink
[api] Allows to load .pt or .onnx file from jar url (#2955)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu authored Jan 20, 2024
1 parent fd453d9 commit 3bcece6
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,10 @@ public Repository newInstance(String name, URI uri) {

Path path = Paths.get(parseFilePath(uri));
String fileName = path.toFile().getName();
if (!FilenameUtils.isArchiveFile(fileName)) {
throw new IllegalArgumentException("Only archive file is supported for res URL.");
if (FilenameUtils.isArchiveFile(fileName)) {
fileName = FilenameUtils.getNamePart(fileName);
}

fileName = FilenameUtils.getNamePart(fileName);
return new JarRepository(name, uri, fileName, queryString);
}

Expand Down

0 comments on commit 3bcece6

Please sign in to comment.