Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion gptqmodel/models/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ def eval(
load_kwargs = {}

if llm_backend == "vllm":
load_backend = BACKEND.VLLM
disallowed_keys = {"pretrained", "tokenizer", "gptqmodel", "trust_remote_code", "backend", "model_id_or_path"}
load_kwargs = {k: v for k, v in model_args.items() if k not in disallowed_keys}

Expand Down
7 changes: 5 additions & 2 deletions gptqmodel/models/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ def from_quantized(

qcfg.calculate_bits_per_weight()

tokenizer = AutoTokenizer.from_pretrained(model_id_or_path, trust_remote_code=trust_remote_code)

if backend == BACKEND.VLLM or backend == BACKEND.SGLANG:
if backend == BACKEND.VLLM:
if qcfg.format != FORMAT.GPTQ and qcfg.format != FORMAT.GEMM:
Expand Down Expand Up @@ -409,7 +411,10 @@ def from_quantized(
model,
quantized=True,
quantize_config=qcfg,
tokenizer=tokenizer,
qlinear_kernel=None,
load_quantized_model=True,
trust_remote_code=trust_remote_code,
model_local_path=model_local_path,
)

Expand Down Expand Up @@ -784,8 +789,6 @@ def assign(mod, device_id):

model.eval()

tokenizer = AutoTokenizer.from_pretrained(model_id_or_path, trust_remote_code=trust_remote_code)

if backend == BACKEND.MLX:
import tempfile
try:
Expand Down