File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1232,7 +1232,8 @@ def embed_stream(
12321232 for embedding in parser .iter_embeddings ():
12331233 # The parser sets embedding.text correctly for multiple embedding types
12341234 # Adjust the global index based on text position in batch
1235- if embedding .text and embedding .text in batch_texts :
1235+ # Use 'is not None' to handle empty strings correctly (they are falsy but valid)
1236+ if embedding .text is not None and embedding .text in batch_texts :
12361237 # Get or create the set of used indices for this embedding type
12371238 emb_type = embedding .embedding_type
12381239 if emb_type not in used_batch_indices_by_type :
Original file line number Diff line number Diff line change @@ -610,7 +610,8 @@ def embed_stream(
610610 for embedding in parser .iter_embeddings ():
611611 # The parser sets embedding.text correctly for multiple embedding types
612612 # Adjust the global index based on text position in batch
613- if embedding .text and embedding .text in batch_texts :
613+ # Use 'is not None' to handle empty strings correctly (they are falsy but valid)
614+ if embedding .text is not None and embedding .text in batch_texts :
614615 # Get or create the set of used indices for this embedding type
615616 emb_type = embedding .embedding_type
616617 if emb_type not in used_batch_indices_by_type :
You can’t perform that action at this time.
0 commit comments