Unverified Commit b03d2621 authored by Florian Zimmermeister's avatar Florian Zimmermeister Committed by GitHub
Browse files

add transformers gptq support (#963)

Proposal to fix
https://github.com/huggingface/text-generation-inference/issues/962
parent 935a77fb
......@@ -223,6 +223,17 @@ class Weights:
return bits, groupsize
def _set_gptq_params(self, model_id):
filename = "config.json"
try:
if os.path.exists(os.path.join(model_id, filename)):
filename = os.path.join(model_id, filename)
else:
filename = hf_hub_download(model_id, filename=filename)
with open(filename, "r") as f:
data = json.load(f)
self.gptq_bits = data["quantization_config"]["bits"]
self.gptq_groupsize = data["quantization_config"]["group_size"]
except Exception:
filename = "quantize_config.json"
try:
if os.path.exists(os.path.join(model_id, filename)):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment