Repository navigation
feature(embeddings): add embedding workflow + cpu/gpu workers - #123
Merged
Merged
Conversation
winsomeglint
commented
Oct 21, 2026
Contributor
- adds an HFEmbedder working with HuggingFace models exposing a jina-embeddings-like encode method (task + prompt name)
- adds publish jobs for datashare-extract-cpu-worker and datashare-extract-gpu-worker
winsomeglint
force-pushed
the
lsummerbll/extract-worker-embedding
branch
from
October 21, 2026 14:37
79c3b4f to
f0ccb3c
Compare
ClemDoum
reviewed
Oct 21, 2026
| output_path: Path, | ||
| progress: AsyncProgressRateHandler | None = None, | ||
| ) -> EmbeddingResponse: | ||
| docs = list(read_jsonl_as(batch, PROCESSED_FILE_TA)) |
Contributor
There was a problem hiding this comment.
To avoid heartbeat timeout we can do something like using the async API:
[d async for d in async_read_jsonl_as()]
| if await es_client.indices.exists(index=index): | ||
| return | ||
| logger.info("creating embeddings index %s...", index) | ||
| await es_client.indices.create( |
Contributor
There was a problem hiding this comment.
I don't think we'll have permission to do so, maybe we can just raise
for tests we can create the index in the fixtures
| # run chunking and inference in a separate thread to avoid | ||
| # blocking the event loop | ||
| chunks = await asyncio.to_thread( | ||
| _embed_doc, |
Contributor
There was a problem hiding this comment.
if heartbeat timeouts are recurrent we can also make _embed_doc an async corouting, use async_open when reading files and isolate calls to text embedding with asyncio.to_thread
Contributor
Author
There was a problem hiding this comment.
maybe it would be better to put heartbeating in a background task?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.