Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
17c68436
Commit
17c68436
authored
Jul 01, 2024
by
Jun Siang Cheah
Browse files
refac: lazily load faster_whisper to reduce start up memory usage
parent
f7707341
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
backend/apps/audio/main.py
backend/apps/audio/main.py
+2
-1
backend/apps/images/main.py
backend/apps/images/main.py
+0
-1
No files found.
backend/apps/audio/main.py
View file @
17c68436
...
...
@@ -14,7 +14,6 @@ from fastapi import (
from
fastapi.responses
import
StreamingResponse
,
JSONResponse
,
FileResponse
from
fastapi.middleware.cors
import
CORSMiddleware
from
faster_whisper
import
WhisperModel
from
pydantic
import
BaseModel
import
uuid
...
...
@@ -277,6 +276,8 @@ def transcribe(
f
.
close
()
if
app
.
state
.
config
.
STT_ENGINE
==
""
:
from
faster_whisper
import
WhisperModel
whisper_kwargs
=
{
"model_size_or_path"
:
WHISPER_MODEL
,
"device"
:
whisper_device_type
,
...
...
backend/apps/images/main.py
View file @
17c68436
...
...
@@ -12,7 +12,6 @@ from fastapi import (
Form
,
)
from
fastapi.middleware.cors
import
CORSMiddleware
from
faster_whisper
import
WhisperModel
from
constants
import
ERROR_MESSAGES
from
utils.utils
import
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment