mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-22 06:02:06 -05:00
[PR #3558] [MERGED] refac: reduce startup memory usage #8075
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/3558
Author: @cheahjs
Created: 7/1/2024
Status: ✅ Merged
Merged: 7/1/2024
Merged by: @tjbck
Base:
dev← Head:refac/reduce-startup-mem-usage📝 Commits (2)
17c6843refac: lazily load faster_whisper to reduce start up memory usagea48ac6arefac: lazily load sentence_transformers to reduce start up memory usage📊 Changes
4 files changed (+8 additions, -6 deletions)
View changed files
📝
backend/apps/audio/main.py(+2 -1)📝
backend/apps/images/main.py(+0 -1)📝
backend/apps/rag/main.py(+4 -2)📝
backend/apps/rag/utils.py(+2 -2)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Delay imports of
faster_whisperandsentence_transformersuntil they are needed. In the event that local STT or RAG is not used, this reduces startup memory usage when used with non-local embeddings from ~400MB to ~160MB.Memory flamegraphs:
faster_whisper(388MB): https://yolo-bucket.jscheah.me/memray-flamegraph-uvicorn.67752.htmlfaster_whisperandsentence_transformers(163MB): https://yolo-bucket.jscheah.me/memray-flamegraph-uvicorn.69138.html🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.