Handle binary blobs (#1493)
This commit is contained in:
parent
5edc0cba7e
commit
791a75f7a3
1 changed files with 11 additions and 0 deletions
|
|
@ -79,15 +79,26 @@ export class LanceDbIndex implements CodebaseIndex {
|
|||
const content = contents[i];
|
||||
const chunks: Chunk[] = [];
|
||||
|
||||
let hasEmptyChunks = false;
|
||||
|
||||
for await (const chunk of chunkDocument(
|
||||
items[i].path,
|
||||
content,
|
||||
LanceDbIndex.MAX_CHUNK_SIZE,
|
||||
items[i].cacheKey,
|
||||
)) {
|
||||
if (chunk.content.length == 0) {
|
||||
hasEmptyChunks = true;
|
||||
break;
|
||||
}
|
||||
chunks.push(chunk);
|
||||
}
|
||||
|
||||
if (hasEmptyChunks) {
|
||||
// File did not chunk properly, let's skip it.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (chunks.length > 20) {
|
||||
// Too many chunks to index, probably a larger file than we want to include
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue