Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
xyang16 committed Jul 11, 2024
1 parent 4893401 commit ca0f1ce
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ private static void loadLibrary() {
private static Path copyJniLibrary(String[] libs) {
Path cacheDir = Utils.getEngineCacheDir("tokenizers");
Platform platform = Platform.detectPlatform("tokenizers");
String os = platform.getOsPrefix();
String classifier = platform.getClassifier();
String flavor = platform.getFlavor();
String version = platform.getVersion();
Expand All @@ -95,10 +96,8 @@ private static Path copyJniLibrary(String[] libs) {
return dir.toAbsolutePath();
}

boolean isCuda = flavor.contains("cu");

// For cuda, download jni lib files
if (isCuda) {
// For Linux cuda 12.x, download JNI lib files
if (flavor.startsWith("cu12") && !"win".equals(os)) {
Matcher matcher = VERSION_PATTERN.matcher(version);
if (!matcher.matches()) {
throw new EngineException("Unexpected version: " + version);
Expand All @@ -110,7 +109,7 @@ private static Path copyJniLibrary(String[] libs) {
return dir;
}

// For cpu, extract jni lib files from classpath
// Extract JNI lib files from classpath
Path tmp = null;
try {
Files.createDirectories(cacheDir);
Expand Down

0 comments on commit ca0f1ce

Please sign in to comment.