Spaces:
Runtime error
Runtime error
Update fastapi_app.py
Browse files- fastapi_app.py +2 -2
fastapi_app.py
CHANGED
@@ -3,11 +3,11 @@ from fastapi import FastAPI, File, UploadFile, HTTPException
|
|
3 |
from fastapi.responses import JSONResponse, RedirectResponse
|
4 |
from tempfile import NamedTemporaryFile
|
5 |
import whisper
|
6 |
-
import torch
|
7 |
from typing import List
|
8 |
|
9 |
# Set a writable cache directory for Whisper models
|
10 |
-
os.
|
|
|
11 |
|
12 |
# Checking if NVIDIA GPU is available
|
13 |
DEVICE = "cpu"
|
|
|
3 |
from fastapi.responses import JSONResponse, RedirectResponse
|
4 |
from tempfile import NamedTemporaryFile
|
5 |
import whisper
|
|
|
6 |
from typing import List
|
7 |
|
8 |
# Set a writable cache directory for Whisper models
|
9 |
+
os.makedirs("/app/whisper_cache", exist_ok=True) # Create a writable directory
|
10 |
+
os.environ["XDG_CACHE_HOME"] = "/app/whisper_cache" # Use the new writable directory
|
11 |
|
12 |
# Checking if NVIDIA GPU is available
|
13 |
DEVICE = "cpu"
|