Skip to content

Commit

Permalink
Fix model loading
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelklehr committed Jul 31, 2024
1 parent 082c2a1 commit 4e17658
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ def load_models():
dir_path = os.path.dirname(os.path.realpath(__file__))
for file in os.scandir(dir_path + "/../models/"):
if os.path.isdir(file.path):
models[file.name] = lambda: WhisperModel(file.path, device="cpu")
models[file.name] = create_model_loader(file.path)
for file in os.scandir(persistent_storage()):
if os.path.isdir(file.path):
models[file.name] = lambda: WhisperModel(file.path, device="cpu")
models[file.name] = create_model_loader(file.path)

return models

def create_model_loader(file_path):
return lambda: WhisperModel(file_path, device="cpu")


models = load_models()

Expand Down

0 comments on commit 4e17658

Please sign in to comment.