Merge pull request #43 from apacha/fix_no_models_available

Raise error when no models were loaded
pull/52/head
vahidrezanezhad 2 years ago committed by GitHub
commit 2355d0ec8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,7 +34,9 @@ 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:
self.models.append(self.load_model(model_file)) self.models.append(self.load_model(model_file))

Loading…
Cancel
Save