MCPcopy Index your code
hub / github.com/OpenMOSS/MOSS / quantize_with_gptq

Function quantize_with_gptq

models/quantization.py:385–393  ·  view source on GitHub ↗
(model, wbits, groupsize)

Source from the content-addressed store, hash-verified

383
384
385def quantize_with_gptq(model, wbits, groupsize):
386 model = model.eval()
387 layers = find_layers(model)
388 for name in ['lm_head']:
389 if name in layers:
390 del layers[name]
391 make_quant(model, layers, wbits, groupsize)
392 # model.load_state_dict(torch.load(checkpoint))
393 return model

Callers 1

quantizeMethod · 0.85

Calls 2

find_layersFunction · 0.85
make_quantFunction · 0.85

Tested by

no test coverage detected