mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-29 10:59:32 +01:00
Don't require GPT-J to be installed to load gpt4chan
This commit is contained in:
parent
6cbfe19c23
commit
a751d7e693
@ -47,7 +47,7 @@ def load_model(model_name):
|
||||
model = AutoModelForCausalLM.from_pretrained(Path(f"models/{model_name}"), low_cpu_mem_usage=True, torch_dtype=dtype)
|
||||
|
||||
# Loading the tokenizer
|
||||
if model_name.lower().startswith('gpt4chan'):
|
||||
if model_name.lower().startswith('gpt4chan') and Path(f"models/gpt-j-6B/").exists():
|
||||
tokenizer = AutoTokenizer.from_pretrained(Path("models/gpt-j-6B/"))
|
||||
elif model_name in ['flan-t5', 't5-large']:
|
||||
tokenizer = T5Tokenizer.from_pretrained(Path(f"models/{model_name}/"))
|
||||
|
Loading…
Reference in New Issue
Block a user