mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
Concise model matching
This commit is contained in:
parent
c1f3dd310c
commit
a067f38544
@ -96,12 +96,8 @@ class GPT4All():
|
|||||||
# If model file does not exist, download
|
# If model file does not exist, download
|
||||||
elif allow_download:
|
elif allow_download:
|
||||||
# Make sure valid model filename before attempting download
|
# Make sure valid model filename before attempting download
|
||||||
model_match = False
|
available_models = GPT4All.list_models()
|
||||||
for item in GPT4All.list_models():
|
if model_filename not in (m["filename"] for m in available_models):
|
||||||
if model_filename == item["filename"]:
|
|
||||||
model_match = True
|
|
||||||
break
|
|
||||||
if not model_match:
|
|
||||||
raise ValueError(f"Model filename not in model list: {model_filename}")
|
raise ValueError(f"Model filename not in model list: {model_filename}")
|
||||||
return GPT4All.download_model(model_filename, model_path)
|
return GPT4All.download_model(model_filename, model_path)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user