mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-10 11:54:52 +00:00
Load quantize_config.json
from local path
This commit is contained in:
parent
9f18f4c006
commit
987b0fff3a
@ -220,9 +220,13 @@ class Weights:
|
||||
|
||||
return bits, groupsize
|
||||
|
||||
def _set_gptq_params(self, model_id):
|
||||
def _set_gptq_params(self, model_id: str):
|
||||
try:
|
||||
filename = hf_hub_download(model_id, filename="quantize_config.json")
|
||||
potential_local_path = Path(model_id, "quantize_config.json")
|
||||
if potential_local_path.exists():
|
||||
filename = potential_local_path
|
||||
else:
|
||||
filename = hf_hub_download(model_id, filename="quantize_config.json")
|
||||
with open(filename, "r") as f:
|
||||
data = json.load(f)
|
||||
self.gptq_bits = data["bits"]
|
||||
|
Loading…
Reference in New Issue
Block a user