Small fix to raise an exception when no model was found instead of failing later with TypeError: 'int' object is not subscriptable.

This commit is contained in:
Alexander Pacha 2022-08-22 10:36:43 +02:00
parent c99be55af2
commit 55a9fba677

View file

@ -34,6 +34,8 @@ class SbbBinarizer:
self.start_new_session() self.start_new_session()
self.model_files = glob('%s/*.h5' % self.model_dir) self.model_files = glob('%s/*.h5' % self.model_dir)
if not self.model_files:
raise ValueError(f"No models found in {self.model_dir}")
self.models = [] self.models = []
for model_file in self.model_files: for model_file in self.model_files: