From a75e02de4d7338b6cc8337ac94aa64b7ee32997a Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 13 Apr 2023 12:13:07 -0300 Subject: [PATCH] Simplify GPTQ_loader.py --- modules/GPTQ_loader.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/GPTQ_loader.py b/modules/GPTQ_loader.py index 96189c31..8e0066a9 100644 --- a/modules/GPTQ_loader.py +++ b/modules/GPTQ_loader.py @@ -111,12 +111,10 @@ def load_quantized(model_name): pt_path = None priority_name_list = [ Path(f'{shared.args.model_dir}/{model_name}{hyphen}{shared.args.wbits}bit{group}{ext}') - for ext in ['.safetensors', '.pt'] for group in ([f'-{shared.args.groupsize}g', ''] if shared.args.groupsize > 0 else ['']) + for ext in ['.safetensors', '.pt'] for hyphen in ['-', f'/{model_name}-', '/'] ] - if shared.args.groupsize > 0: - priority_name_list = [i for i in priority_name_list if str(shared.args.groupsize) in i.name] + [i for i in priority_name_list if str(shared.args.groupsize) not in i.name] for path in priority_name_list: if path.exists(): pt_path = path