Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|