Skip to content

Commit 0714180

Browse files
committed
fix: type checking
1 parent ccd0a7f commit 0714180

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

integrations/ollama/src/haystack_integrations/components/embedders/ollama/document_embedder.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ async def _embed_batch_async(
151151

152152
results = await asyncio.gather(*tasks, return_exceptions=True)
153153

154-
for _idx, res in enumerate(results):
154+
for idx, res in enumerate(results):
155+
if isinstance(res, BaseException):
156+
err_msg = f"Embedding batch {idx} raised an exception."
157+
raise RuntimeError(err_msg)
155158
all_embeddings.extend(res["embeddings"])
156159

157160
return all_embeddings

0 commit comments

Comments
 (0)