Suggestion: batch call for text embeddings

Đang mở
#1,663 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
pytorch, react-native, typescript
Lĩnh vực
machine-learning, mobile

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
1.8k
Fork
102
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
46

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của software-mansion/react-native-executorch

Tất cả issue của software-mansion/react-native-executorch

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.