mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-12-25 05:48:55 +01:00
Fix loading condition for universal llama tokenizer (#2753)
This commit is contained in:
parent
490a1795f0
commit
def3b69002
@ -86,7 +86,7 @@ def load_tokenizer(model_name, model):
|
|||||||
tokenizer = AutoTokenizer.from_pretrained(Path(f"{shared.args.model_dir}/gpt-j-6B/"))
|
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 type(model) is transformers.LlamaForCausalLM or "LlamaGPTQForCausalLM" in str(type(model)):
|
||||||
# Try to load an universal LLaMA tokenizer
|
# Try to load an universal LLaMA tokenizer
|
||||||
if any(s in shared.model_name.lower() for s in ['llava', 'oasst']):
|
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/")]:
|
for p in [Path(f"{shared.args.model_dir}/llama-tokenizer/"), Path(f"{shared.args.model_dir}/oobabooga_llama-tokenizer/")]:
|
||||||
if p.exists():
|
if p.exists():
|
||||||
logger.info(f"Loading the universal LLaMA tokenizer from {p}...")
|
logger.info(f"Loading the universal LLaMA tokenizer from {p}...")
|
||||||
|
Loading…
Reference in New Issue
Block a user