Skip to content

Commit

Permalink
fix the usual merge mess
Browse files Browse the repository at this point in the history
  • Loading branch information
fxmarty committed Jul 13, 2023
1 parent 9401e10 commit 74e6d6e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions server/text_generation_server/utils/weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,18 @@ def get_multi_weights_row(self, prefix: str, quantize: str):
else:
weight = self.get_sharded(f"{prefix}.weight", dim=1)
return weight

def get_gptq_qparams(self) -> Tuple[int, int]:
try:
bits = self.get_tensor("gptq_bits").item()
groupsize = self.get_tensor("gptq_groupsize").item()
except (SafetensorError, RuntimeError) as e:
try:
import os

bits = int(os.getenv("GPTQ_BITS"))
groupsize = int(os.getenv("GPTQ_GROUPSIZE"))
except Exception:
raise e

return bits, groupsize

0 comments on commit 74e6d6e

Please sign in to comment.