Skip to content

Commit 518e5c4

Browse files
committed
Some minor fixes to the GPTQ loader
1 parent 8778b75 commit 518e5c4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/quant_loader.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import modules.shared as shared
88

99
sys.path.insert(0, str(Path("repositories/GPTQ-for-LLaMa")))
10+
import llama
11+
import opt
1012

1113

1214
def load_quantized(model_name):
@@ -21,9 +23,9 @@ def load_quantized(model_name):
2123
model_type = shared.args.gptq_model_type.lower()
2224

2325
if model_type == 'llama':
24-
from llama import load_quant
26+
load_quant = llama.load_quant
2527
elif model_type == 'opt':
26-
from opt import load_quant
28+
load_quant = opt.load_quant
2729
else:
2830
print("Unknown pre-quantized model type specified. Only 'llama' and 'opt' are supported")
2931
exit()
@@ -50,7 +52,7 @@ def load_quantized(model_name):
5052
print(f"Could not find {pt_model}, exiting...")
5153
exit()
5254

53-
model = load_quant(path_to_model, str(pt_path), shared.args.gptq_bits)
55+
model = load_quant(str(path_to_model), str(pt_path), shared.args.gptq_bits)
5456

5557
# Multiple GPUs or GPU+CPU
5658
if shared.args.gpu_memory:

0 commit comments

Comments
 (0)