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
frankfliu committed Apr 26, 2024
1 parent 2f9c6d3 commit 77d76fa
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 77d76fa

Please sign in to comment.