From 4526cce0ffb59284bf53f3a1f7cc76c12ed5d87b Mon Sep 17 00:00:00 2001
From: Rasmus Larsen <rasmus.larsen@alexandra.dk>
Date: Mon, 30 Jan 2023 17:30:18 +0100
Subject: [PATCH] use a more standard model storage path, and make the
 directory if doesn't exist

---
 whispercpp.pyx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/whispercpp.pyx b/whispercpp.pyx
index abbbc0d..72fa39e 100644
--- a/whispercpp.pyx
+++ b/whispercpp.pyx
@@ -7,7 +7,7 @@ import requests
 import os
 from pathlib import Path
 
-MODELS_DIR = str(Path('~/ggml-models').expanduser())
+MODELS_DIR = str(Path('~/.ggml-models').expanduser())
 print("Saving models to:", MODELS_DIR)
 
 
@@ -37,6 +37,7 @@ def download_model(model):
     print(f'Downloading {model}...')
     url = MODELS[model.decode()]
     r = requests.get(url, allow_redirects=True)
+    os.makedirs(MODELS_DIR, exist_ok=True)
     with open(MODELS_DIR + "/" + model.decode(), 'wb') as f:
         f.write(r.content)
 
@@ -78,7 +79,6 @@ cdef whisper_full_params default_params() nogil:
     params.print_realtime = True
     params.print_progress = True
     params.translate = False
-    params.language = <const char *> LANGUAGE
     n_threads = N_THREADS
     return params