From 5646690769ea0d8a9329b027d4f78caf4fbea6ac Mon Sep 17 00:00:00 2001 From: Panchovix Date: Fri, 23 Jun 2023 10:31:02 -0400 Subject: [PATCH] Fix some models not loading on exllama_hf (#2835) --- modules/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/models.py b/modules/models.py index 574e164..28f6be6 100644 --- a/modules/models.py +++ b/modules/models.py @@ -85,7 +85,7 @@ def load_tokenizer(model_name, model): tokenizer = None if any(s in model_name.lower() for s in ['gpt-4chan', 'gpt4chan']) and Path(f"{shared.args.model_dir}/gpt-j-6B/").exists(): tokenizer = AutoTokenizer.from_pretrained(Path(f"{shared.args.model_dir}/gpt-j-6B/")) - elif type(model) is transformers.LlamaForCausalLM or "LlamaGPTQForCausalLM" in str(type(model)): + elif model.__class__.__name__ in ['LlamaForCausalLM', 'LlamaGPTQForCausalLM', 'ExllamaHF']: # Try to load an universal LLaMA tokenizer if not any(s in shared.model_name.lower() for s in ['llava', 'oasst']): for p in [Path(f"{shared.args.model_dir}/llama-tokenizer/"), Path(f"{shared.args.model_dir}/oobabooga_llama-tokenizer/")]: