mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
(fix)(chat) 修复做embedding检索时,出现重复数据的问题 (#1643)
This commit is contained in:
@@ -59,6 +59,7 @@ public class EmbeddingServiceImpl implements EmbeddingService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
embeddingStore.add(embedding, query);
|
embeddingStore.add(embedding, query);
|
||||||
|
cache.put(TextSegmentConvert.getQueryId(query), true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(
|
log.error(
|
||||||
"embeddingModel embed error question: {}, embeddingStore: {}",
|
"embeddingModel embed error question: {}, embeddingStore: {}",
|
||||||
@@ -117,6 +118,9 @@ public class EmbeddingServiceImpl implements EmbeddingService {
|
|||||||
new MetadataFilterBuilder(TextSegmentConvert.QUERY_ID);
|
new MetadataFilterBuilder(TextSegmentConvert.QUERY_ID);
|
||||||
Filter filter = filterBuilder.isIn(queryIds);
|
Filter filter = filterBuilder.isIn(queryIds);
|
||||||
inMemoryEmbeddingStore.removeAll(filter);
|
inMemoryEmbeddingStore.removeAll(filter);
|
||||||
|
for (String queryId : queryIds) {
|
||||||
|
cache.put(queryId, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("Not supported yet.");
|
throw new RuntimeException("Not supported yet.");
|
||||||
|
|||||||
Reference in New Issue
Block a user