[Bug]: SparseTextEmbedding needs to implement aembed for non-blocking use (async/await)

Aperta
#546 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia da fastembed/sparse/sparse_text_embedding.py e confronta l'API pubblica della classe sparse con l'uso asincrono mostrato nel report. Riproduci SparseTextEmbedding('Qdrant/bm25').aembed_query("foo bar") e verifica che l'uso di async/await non generi più AttributeError; il comportamento previsto è avere a disposizione un metodo di embedding non bloccante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happened?

I want to be able to use non-blocking embedding, via "aembed" (async/await). This API is missing in this class, but it is part of the expected contract.

What is the expected behaviour?

When an AsyncQdrantClient is used, aembed can be used (async/await) as well. I am talking about https://github.com/langchain-ai/langchain/issues/32195 and testing the patch https://github.com/langchain-ai/langchain/pull/32196/files#r2226270515

I tried a hybrid search and, fair enough, "aembed" works fine with the dense variation but not with the sparse one (fast-sparse-bm25)

A minimal reproducible example
from fastembed.sparse.sparse_text_embedding import SparseTextEmbedding

embedding = SparseTextEmbedding('Qdrant/bm25')
embedding.aembed_query("foo bar")
    embedding.aembed_query("foo bar")
    ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SparseTextEmbedding' object has no attribute 'aembed_query'
What Python version are you on? e.g. python --version

Python 3.11.10

FastEmbed version

fastembed==0.7.1

What os are you seeing the problem on?

MacOS

Relevant stack traces and/or logs

Lingua principale
Python
Stelle
3.3k
Fork
314
Merge medio
5g 7h
PR unite (30g)
23

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di qdrant/fastembed

Tutte le issue di qdrant/fastembed

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.