Spaces:
Sleeping
Sleeping
added whisper operating
Browse files
app.py
CHANGED
|
@@ -39,8 +39,11 @@ filepath = os.path.abspath("cnn_1_v6_final_model.h5")
|
|
| 39 |
if not os.path.exists(filepath):
|
| 40 |
raise FileNotFoundError(f"Model file not found at {filepath}")
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
model = keras.models.load_model(filepath, compile=False)
|
| 43 |
-
whisper_model = whisper.load_model("tiny")
|
| 44 |
|
| 45 |
@contextmanager
|
| 46 |
def temporary_audio_file(audio_bytes):
|
|
|
|
| 39 |
if not os.path.exists(filepath):
|
| 40 |
raise FileNotFoundError(f"Model file not found at {filepath}")
|
| 41 |
|
| 42 |
+
cache_dir = os.path.join(os.getcwd(), "whisper_cache")
|
| 43 |
+
os.makedirs(cache_dir, exist_ok=True)
|
| 44 |
+
whisper_model = whisper.load_model("tiny", download_root=cache_dir)
|
| 45 |
+
|
| 46 |
model = keras.models.load_model(filepath, compile=False)
|
|
|
|
| 47 |
|
| 48 |
@contextmanager
|
| 49 |
def temporary_audio_file(audio_bytes):
|