(improvement)(common) Upgraded langchain4j to version 0.31. (#1174)

This commit is contained in:
lexluo09
2024-06-20 17:31:19 +08:00
committed by GitHub
parent 1df1fe5ad6
commit 92db381b6f
37 changed files with 241 additions and 888 deletions

View File

@@ -1,12 +1,13 @@
package dev.langchain4j.model.embedding;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.commons.lang3.StringUtils;
/**
* An embedding model that runs within your Java application's process.
@@ -51,7 +52,7 @@ public class S2OnnxEmbeddingModel extends AbstractInProcessEmbeddingModel {
try {
return new OnnxBertBiEncoder(
Files.newInputStream(pathToModel),
vocabularyFile,
vocabularyFile.openStream(),
PoolingMode.MEAN
);
} catch (IOException e) {