Move all gradio elements to shared (so that extensions can use them)

This commit is contained in:
oobabooga 2023-02-24 16:46:50 -03:00
parent 0a3590da8c
commit 65326b545a
6 changed files with 127 additions and 124 deletions

View file

@ -117,7 +117,7 @@ def load_model(model_name):
model = eval(command)
# Loading the tokenizer
if shared.model_name.lower().startswith(('gpt4chan', 'gpt-4chan', '4chan')) and Path(f"models/gpt-j-6B/").exists():
if shared.model_name.lower().startswith(('gpt4chan', 'gpt-4chan', '4chan')) and Path("models/gpt-j-6B/").exists():
tokenizer = AutoTokenizer.from_pretrained(Path("models/gpt-j-6B/"))
else:
tokenizer = AutoTokenizer.from_pretrained(Path(f"models/{shared.model_name}/"))