forked from open-webui/open-webui
docker improvements & changed universal device type env for different models used
This commit is contained in:
parent
132d741c55
commit
1f6739337b
4 changed files with 36 additions and 19 deletions
|
@ -21,7 +21,11 @@ from utils.utils import (
|
|||
)
|
||||
from utils.misc import calculate_sha256
|
||||
|
||||
from config import CACHE_DIR, UPLOAD_DIR, WHISPER_MODEL, WHISPER_MODEL_DIR
|
||||
from config import CACHE_DIR, UPLOAD_DIR, WHISPER_MODEL, WHISPER_MODEL_DIR, DEVICE_TYPE
|
||||
|
||||
if DEVICE_TYPE != "cuda":
|
||||
whisper_device_type = "cpu"
|
||||
|
||||
|
||||
app = FastAPI()
|
||||
app.add_middleware(
|
||||
|
@ -56,7 +60,7 @@ def transcribe(
|
|||
|
||||
model = WhisperModel(
|
||||
WHISPER_MODEL,
|
||||
device="auto",
|
||||
device=whisper_device_type,
|
||||
compute_type="int8",
|
||||
download_root=WHISPER_MODEL_DIR,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue