From a8409426d7630c7b2749a3fa6c36321ce7b92415 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Wed, 26 Apr 2023 01:55:40 -0300 Subject: [PATCH] Fix bug in models.py --- modules/models.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/models.py b/modules/models.py index d8131eda..bd1cb5ec 100644 --- a/modules/models.py +++ b/modules/models.py @@ -40,20 +40,20 @@ if shared.args.deepspeed: def find_model_type(model_name): - model_name = model_name.lower() - if 'rwkv-' in model_name: + model_name_lower = model_name.lower() + if 'rwkv-' in model_name_lower: return 'rwkv' elif len(list(Path(f'{shared.args.model_dir}/{model_name}').glob('*ggml*.bin'))) > 0: return 'llamacpp' - elif re.match('.*ggml.*\.bin', model_name): + elif re.match('.*ggml.*\.bin', model_name_lower): return 'llamacpp' - elif 'chatglm' in model_name: + elif 'chatglm' in model_name_lower: return 'chatglm' - elif 'galactica' in model_name: + elif 'galactica' in model_name_lower: return 'galactica' - elif 'llava' in model_name: + elif 'llava' in model_name_lower: return 'llava' - elif any((k in model_name for k in ['gpt4chan', 'gpt-4chan'])): + elif any((k in model_name_lower for k in ['gpt4chan', 'gpt-4chan'])): return 'gpt4chan' else: config = AutoConfig.from_pretrained(f"{shared.args.model_dir}/{model_name}")