mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-22 06:02:06 -05:00
[PR #5400] [MERGED] fix: if cuda is not available fallback to cpu #8475
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/5400
Author: @thiswillbeyourgithub
Created: 9/13/2024
Status: ✅ Merged
Merged: 9/14/2024
Merged by: @tjbck
Base:
dev← Head:fix_fallback_cuda📝 Commits (2)
a7ea070fix: if cuda is not available fallback to cpu82b3549pep8📊 Changes
2 files changed (+29 additions, -1 deletions)
View changed files
📝
backend/open_webui/__init__.py(+13 -0)📝
backend/open_webui/env.py(+16 -1)📄 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
USE_CUDA_DOCKERtotrueand (for one reason or another) CUDA is not available: fallback to CPU.Added
Additional Information
Related to the issue that caused #5378 in my case. My CUDA was not available for reasons unrelated to Open-WebUI but no check whatsoever was done until something tried to use cuda. In my case it was the hybrid search.
@tjbck I think this too illustrates that Open-WebUI does not have appropriate checks. IMO, asserts are cheap and will save everyone a lot of headache.
If I may offer an unsolicited piece of advice, click me.
Edit: Sorry for the mess in the #5396 branch. The relevant code was moved from config.py to env.py. I did a workaround to log the exception when logging was initialized instead of moving the whole code arround. LMK if that's okay with you.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.