mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Check if the .pt file exists
This commit is contained in:
parent
828a524f9a
commit
2965aa1625
@ -102,6 +102,10 @@ def load_model(model_name):
|
||||
if path_to_model.name.lower().startswith('llama-30b'):
|
||||
pt_model = 'llama-30b-4bit.pt'
|
||||
|
||||
if not Path(f"models/{pt_model}").exists():
|
||||
print(f"Could not find models/{pt_model}, exiting...")
|
||||
exit()
|
||||
|
||||
model = load_quant(path_to_model, Path(f"models/{pt_model}"), 4)
|
||||
model = model.to(torch.device('cuda:0'))
|
||||
|
||||
@ -178,4 +182,3 @@ def load_soft_prompt(name):
|
||||
shared.soft_prompt_tensor = tensor
|
||||
|
||||
return name
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user