From 342e756878c8f9b565c409c9b35beced1c06173d Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 7 Jan 2023 12:21:04 -0300 Subject: [PATCH] Better recognize the model sizes --- server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.py b/server.py index b006764..372bce5 100644 --- a/server.py +++ b/server.py @@ -30,7 +30,7 @@ def load_model(model_name): print("Loading in .pt format...") model = torch.load(f"torch-dumps/{model_name}.pt").cuda() elif model_name.lower().startswith(('gpt-neo', 'opt-', 'galactica')): - if any(size in model_name for size in ('13b', '20b', '30b')): + if any(size in model_name.lower() for size in ('13b', '20b', '30b')): model = AutoModelForCausalLM.from_pretrained(f"models/{model_name}", device_map='auto', load_in_8bit=True) else: model = AutoModelForCausalLM.from_pretrained(f"models/{model_name}", low_cpu_mem_usage=True, torch_dtype=torch.float16).cuda()