mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Don't need that
This commit is contained in:
parent
00a12889e9
commit
f0013ac8e9
@ -27,11 +27,6 @@ def load_model(model_name):
|
||||
print(f"Loading {model_name}...")
|
||||
t0 = time.time()
|
||||
|
||||
if args.cpu:
|
||||
dtype = torch.float32
|
||||
else:
|
||||
dtype = torch.float16
|
||||
|
||||
# Loading the model
|
||||
if not args.cpu and Path(f"torch-dumps/{model_name}.pt").exists():
|
||||
print("Loading in .pt format...")
|
||||
@ -45,9 +40,9 @@ def load_model(model_name):
|
||||
model = T5ForConditionalGeneration.from_pretrained(Path(f"models/{model_name}")).cuda()
|
||||
else:
|
||||
if args.cpu:
|
||||
model = AutoModelForCausalLM.from_pretrained(Path(f"models/{model_name}"), low_cpu_mem_usage=True, torch_dtype=dtype)
|
||||
model = AutoModelForCausalLM.from_pretrained(Path(f"models/{model_name}"), low_cpu_mem_usage=True, torch_dtype=torch.float32)
|
||||
else:
|
||||
model = AutoModelForCausalLM.from_pretrained(Path(f"models/{model_name}"), low_cpu_mem_usage=True, torch_dtype=dtype).cuda()
|
||||
model = AutoModelForCausalLM.from_pretrained(Path(f"models/{model_name}"), low_cpu_mem_usage=True, torch_dtype=torch.float16).cuda()
|
||||
|
||||
# Loading the tokenizer
|
||||
if model_name.lower().startswith('gpt4chan') and Path(f"models/gpt-j-6B/").exists():
|
||||
|
Loading…
Reference in New Issue
Block a user