mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 17:29:22 +01:00
Update models.py (#3020)
Hopefully fixed error with "ValueError: Tokenizer class GPTNeoXTokenizer does not exist or is not currently imported."
This commit is contained in:
parent
b67c362735
commit
ff45317032
@ -95,11 +95,18 @@ def load_tokenizer(model_name, model):
|
|||||||
if any(s in model_name.lower() for s in ['gpt-4chan', 'gpt4chan']) and Path(f"{shared.args.model_dir}/gpt-j-6B/").exists():
|
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/"))
|
tokenizer = AutoTokenizer.from_pretrained(Path(f"{shared.args.model_dir}/gpt-j-6B/"))
|
||||||
elif path_to_model.exists():
|
elif path_to_model.exists():
|
||||||
tokenizer = AutoTokenizer.from_pretrained(
|
try:
|
||||||
path_to_model,
|
tokenizer = AutoTokenizer.from_pretrained(
|
||||||
trust_remote_code=shared.args.trust_remote_code,
|
path_to_model,
|
||||||
use_fast=False
|
trust_remote_code=shared.args.trust_remote_code,
|
||||||
)
|
use_fast=False
|
||||||
|
)
|
||||||
|
except ValueError:
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained(
|
||||||
|
path_to_model,
|
||||||
|
trust_remote_code=shared.args.trust_remote_code,
|
||||||
|
use_fast=True
|
||||||
|
)
|
||||||
|
|
||||||
if tokenizer.__class__.__name__ == 'LlamaTokenizer':
|
if tokenizer.__class__.__name__ == 'LlamaTokenizer':
|
||||||
pairs = [
|
pairs = [
|
||||||
|
Loading…
Reference in New Issue
Block a user