Manar312 commited on
Commit
af01d97
·
verified ·
1 Parent(s): 206cfdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -380,7 +380,17 @@ def greedy_decode(audio_tensor, orig_len, model, device, max_len=MAX_TEXT_LEN):
380
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
381
  model_state = {"model": None}
382
 
383
- MODEL_PATH = os.getenv("MODEL_PATH", "entire_model.pth")
 
 
 
 
 
 
 
 
 
 
384
 
385
 
386
  @asynccontextmanager
 
380
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
381
  model_state = {"model": None}
382
 
383
+ import gdown
384
+
385
+ MODEL_PATH = "entire_model.pth"
386
+
387
+ if not os.path.exists(MODEL_PATH):
388
+ print("Downloading model from Google Drive...")
389
+ gdown.download(
390
+ "https://drive.google.com/uc?id=16i7ui-yYIWppaylOG2ofkpRlPQWeE4nZ",
391
+ MODEL_PATH,
392
+ quiet=False
393
+ )
394
 
395
 
396
  @asynccontextmanager