Kavin1701 commited on
Commit
93916c1
·
verified ·
1 Parent(s): 15d8556

Update fastapi_app.py

Browse files
Files changed (1) hide show
  1. 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.environ["XDG_CACHE_HOME"] = "/app/.cache" # Use a writable directory
 
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"