Suggestion: batch call for text embeddings

Aperta
#1,663 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
pytorch, react-native, typescript

Direzione di ricerca

Start by reading the existing embed(input: string) implementation and its worklet variant, then trace how text is tokenized and passed to the native runtime. The issue proposes embedBatch(inputs: string[]) with native batching and padding, but does not identify the relevant files or tests. Done means the batch API and worklet variant return one embedding per input and are covered by tests.

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

Descrizione

Problem description

embed(input: string) takes one text. Indexing a corpus means one call per document (5183 documents in our SciFact run = 5183 calls), each paying the JS-to-native and worklet hop.

Proposed solution

Add embedBatch(inputs: string[]): Promise<Float32Array[]> (and a worklet variant) that tokenizes and runs the batch natively, padding inside.

Alternative solutions

No response

Benefits to React Native ExecuTorch

Not a performance problem today: RNE was the fastest embedder we measured on Android (all-MiniLM-L6-v2 int8, about 13 ms per text on both phones). A batch call would send the texts once instead of once per text, and make RAG indexing code simpler.

Additional context

No response

Lingua principale
TypeScript
Stelle
1.8k
Fork
102
Merge medio
2g 6h
PR unite (30g)
46

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 software-mansion/react-native-executorch

Tutte le issue di software-mansion/react-native-executorch

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.