Execute a single query to fetch files for fetched embeddings
This commit is contained in:
parent
20c0d455df
commit
6876e0e85e
1 changed files with 5 additions and 5 deletions
|
@ -133,12 +133,12 @@ class EmbeddingStore {
|
|||
return;
|
||||
}
|
||||
final inputs = <EmbeddingsDecoderInput>[];
|
||||
final fileMap = await FilesDB.instance
|
||||
.getFilesFromIDs(remoteEmbeddings.map((e) => e.fileID).toList());
|
||||
|
||||
for (final embedding in remoteEmbeddings) {
|
||||
final file = await FilesDB.instance.getAnyUploadedFile(embedding.fileID);
|
||||
if (file == null) {
|
||||
continue;
|
||||
}
|
||||
final fileKey = getFileKey(file);
|
||||
final file = fileMap[embedding.fileID];
|
||||
final fileKey = getFileKey(file!);
|
||||
final input = EmbeddingsDecoderInput(embedding, fileKey);
|
||||
inputs.add(input);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue