mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
(improvement)(build) Add spotless during the build process. (#1639)
This commit is contained in:
@@ -10,4 +10,4 @@ class EmbeddingModelProperties {
|
||||
private String modelName;
|
||||
private String modelPath;
|
||||
private String vocabularyPath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ import lombok.Setter;
|
||||
public class EmbeddingStoreProperties {
|
||||
|
||||
private String persistPath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package dev.langchain4j.inmemory.spring;
|
||||
|
||||
|
||||
import dev.langchain4j.model.embedding.AllMiniLmL6V2QuantizedEmbeddingModel;
|
||||
import dev.langchain4j.model.embedding.BgeSmallZhEmbeddingModel;
|
||||
import dev.langchain4j.model.embedding.EmbeddingModel;
|
||||
@@ -42,4 +41,4 @@ public class InMemoryAutoConfig {
|
||||
}
|
||||
return new BgeSmallZhEmbeddingModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,8 @@ public class InMemoryEmbeddingStoreFactory extends BaseEmbeddingStoreFactory {
|
||||
this.embeddingStore = embeddingStore;
|
||||
}
|
||||
|
||||
private static EmbeddingStoreProperties createPropertiesFromConfig(EmbeddingStoreConfig storeConfig) {
|
||||
private static EmbeddingStoreProperties createPropertiesFromConfig(
|
||||
EmbeddingStoreConfig storeConfig) {
|
||||
EmbeddingStoreProperties embeddingStore = new EmbeddingStoreProperties();
|
||||
BeanUtils.copyProperties(storeConfig, embeddingStore);
|
||||
return embeddingStore;
|
||||
@@ -56,7 +57,8 @@ public class InMemoryEmbeddingStoreFactory extends BaseEmbeddingStoreFactory {
|
||||
InMemoryEmbeddingStore<TextSegment> embeddingStore = null;
|
||||
try {
|
||||
EmbeddingConfig embeddingConfig = ContextUtils.getBean(EmbeddingConfig.class);
|
||||
if (Files.exists(filePath) && !collectionName.equals(embeddingConfig.getMetaCollectionName())
|
||||
if (Files.exists(filePath)
|
||||
&& !collectionName.equals(embeddingConfig.getMetaCollectionName())
|
||||
&& !collectionName.equals(embeddingConfig.getText2sqlCollectionName())) {
|
||||
embeddingStore = InMemoryEmbeddingStore.fromFile(filePath);
|
||||
embeddingStore.entries = new CopyOnWriteArraySet<>(embeddingStore.entries);
|
||||
@@ -72,7 +74,8 @@ public class InMemoryEmbeddingStoreFactory extends BaseEmbeddingStoreFactory {
|
||||
if (MapUtils.isEmpty(super.collectionNameToStore)) {
|
||||
return;
|
||||
}
|
||||
for (Map.Entry<String, EmbeddingStore<TextSegment>> entry : collectionNameToStore.entrySet()) {
|
||||
for (Map.Entry<String, EmbeddingStore<TextSegment>> entry :
|
||||
collectionNameToStore.entrySet()) {
|
||||
Path filePath = getPersistPath(entry.getKey());
|
||||
if (Objects.isNull(filePath)) {
|
||||
continue;
|
||||
@@ -101,5 +104,4 @@ public class InMemoryEmbeddingStoreFactory extends BaseEmbeddingStoreFactory {
|
||||
}
|
||||
return Paths.get(persistPath, persistFile);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,7 @@ public class Properties {
|
||||
|
||||
static final String PREFIX = "langchain4j.in-memory";
|
||||
|
||||
@NestedConfigurationProperty
|
||||
EmbeddingStoreProperties embeddingStore;
|
||||
@NestedConfigurationProperty EmbeddingStoreProperties embeddingStore;
|
||||
|
||||
@NestedConfigurationProperty
|
||||
EmbeddingModelProperties embeddingModel;
|
||||
}
|
||||
@NestedConfigurationProperty EmbeddingModelProperties embeddingModel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user