Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion noScribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,9 @@ def collect_models(dir):
for entry in os.listdir(dir):
entry_path = os.path.join(dir, entry)
if os.path.isdir(entry_path):
if not os.path.isfile(os.path.join(entry_path, 'model.bin')):
self.logn(f'Ignored model "{entry}" due to missing model.bin', 'error')
continue
if entry in self.whisper_model_paths:
self.logn(f'Ignored double name for whisper model: "{entry}"', 'error')
else:
Expand All @@ -715,7 +718,10 @@ def collect_models(dir):
# collect user defined models:
collect_models(self.user_models_dir)

return list(self.whisper_model_paths.keys())
models_list = list(self.whisper_model_paths.keys())
if not models_list:
raise Exception('Sorry, no way to run without any valid model')
return models_list

def on_whisper_model_selected(self, value):
print(self.option_menu_whisper_model.old_value)
Expand Down