File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1229,7 +1229,8 @@ def embed_stream(
12291229 for embedding in parser .iter_embeddings ():
12301230 # The parser sets embedding.text correctly for multiple embedding types
12311231 # Adjust the global index based on text position in batch
1232- if embedding .text and embedding .text in batch_texts :
1232+ # Use 'is not None' to handle empty strings correctly (they are falsy but valid)
1233+ if embedding .text is not None and embedding .text in batch_texts :
12331234 # Get or create the set of used indices for this embedding type
12341235 emb_type = embedding .embedding_type
12351236 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