Skip to content

Commit

Permalink
langchain[patch]: Dont load empty strings UnstructuredLoader (#5318)
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul authored May 8, 2024
1 parent efc0c54 commit 7b9ed80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion langchain/src/document_loaders/fs/unstructured.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export class UnstructuredLoader extends BaseDocumentLoader {
const documents: Document[] = [];
for (const element of elements) {
const { metadata, text } = element;
if (typeof text === "string") {
if (typeof text === "string" && text !== "") {
documents.push(
new Document({
pageContent: text,
Expand Down

0 comments on commit 7b9ed80

Please sign in to comment.