mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
refac: lazily load faster_whisper to reduce start up memory usage
This commit is contained in:
parent
f77073410e
commit
17c684369e
2 changed files with 2 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
|
|
|
|||
Loading…
Reference in a new issue