Suggestion: batch call for text embeddings

Aberta
#1,663 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
pytorch, react-native, typescript

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
TypeScript
Estrelas
1.8k
Forks
102
Merge médio
2d 6h
PRs com merge (30d)
46

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de software-mansion/react-native-executorch

Todas as issues de software-mansion/react-native-executorch

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.