michaelfeil / michaelfeil/infinity
Allow to pass SentenceTransformers `task` and `prompt`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 206
- PR merge metrics
- No merged PRs in 30d
Description
### Feature request
I want to use https://huggingface.co/jinaai/jina-embeddings-v3 with via infinity server and client, but I cant find an example to run it with `task` as in `SentenceTransformers`:
```python
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("jinaai/jina-embeddings-v3", trust_remote_code=True)
task = "retrieval.query"
embeddings = model.encode(
["What is the weather like in Berlin today?"],
task=task,
prompt_name=task,
)
```
### Motivation
It will not be practical to use infinity for jinaai embeddings (and some others) without this functionality. Actually, we can prefix our input text with relevant prompt, but we should not.
### Your contribution
I may be the first who will test and give feedback. If you hint me a contribution start point, I can try to cook a PR.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the infinity client and server interfaces for embedding requests, then compare their supported inputs with SentenceTransformers' task and prompt behavior for jinaai/jina-embeddings-v3. Done means both values can be passed through infinity so the shown retrieval.query example works without manually prefixing the text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- huggingface, python
- Domain
- api, machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100