Skip to content

Commit

Permalink
fixed an issue for finding models in emptuy db dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lael Halawani committed Jan 7, 2024
1 parent 4278bd4 commit 6317b28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gguf_modeldb/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ def find_model(self, name_query:Optional[str]=None,
Optional[ModelData]: Top matching ModelData object or None
"""
sorted_models = self.find_models(name_query, quantization_query, keywords_query)
if sorted_models is None:
return None
if sorted_models is None or len(sorted_models) == 0:
if len(self.models) == 0:
print(f"There were no models to be searched. Try importing a verified model or using the defualt db dir.")
raise Exception(f"Could not find a model matching the query: {name_query} {quantization_query} {keywords_query}")
else:
#print(f"Found {len(sorted_models)} models.")
#print(sorted_models)
Expand Down

0 comments on commit 6317b28

Please sign in to comment.