[PR #20096] [CLOSED] fix: pass batch_size to sentence-transformers encode method #64319

Closed
opened 2026-05-06 09:49:16 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/20096
Author: @majiayu000
Created: 12/22/2025
Status: Closed

Base: mainHead: fix/embedding-batch-size-20053


📝 Commits (1)

  • b440a95 fix: pass batch_size to sentence-transformers encode method

📊 Changes

3 files changed (+101 additions, -1 deletions)

View changed files

📝 backend/open_webui/retrieval/utils.py (+3 -1)
backend/open_webui/test/retrieval/__init__.py (+0 -0)
backend/open_webui/test/retrieval/test_utils.py (+98 -0)

📄 Description

Summary

  • Passes batch_size parameter to embedding_function.encode() for SentenceTransformers
  • Allows users to control memory usage by configuring Embedding Batch Size in Admin Settings

Fixes #20053

Test plan

  • Added unit tests to verify batch_size is correctly passed to encode method
  • Manual test: Configure Embedding Batch Size in Admin Settings > Documents
  • Manual test: Upload large document and monitor RAM/VRAM usage

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/20096 **Author:** [@majiayu000](https://github.com/majiayu000) **Created:** 12/22/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/embedding-batch-size-20053` --- ### 📝 Commits (1) - [`b440a95`](https://github.com/open-webui/open-webui/commit/b440a951a5fd369f4d4bc60679349d0ab753d812) fix: pass batch_size to sentence-transformers encode method ### 📊 Changes **3 files changed** (+101 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/retrieval/utils.py` (+3 -1) ➕ `backend/open_webui/test/retrieval/__init__.py` (+0 -0) ➕ `backend/open_webui/test/retrieval/test_utils.py` (+98 -0) </details> ### 📄 Description ## Summary - Passes `batch_size` parameter to `embedding_function.encode()` for SentenceTransformers - Allows users to control memory usage by configuring Embedding Batch Size in Admin Settings Fixes #20053 ## Test plan - [x] Added unit tests to verify batch_size is correctly passed to encode method - [ ] Manual test: Configure Embedding Batch Size in Admin Settings > Documents - [ ] Manual test: Upload large document and monitor RAM/VRAM usage --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 09:49:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#64319