Skip to content

Commit 3628559

Browse files
authored
GPTQ Env vars: catch correct type of error (#596)
# What does this PR do? When passing in environment variables like gptq_bits, we still get errors thrown from TGI because the try/catch block is catching the wrong type of error. This PR aims to fix that. @Narsil - let me know if this is how you want this formatted. My Python is a little shaky, so I hope this syntax is correct.
1 parent f2f0289 commit 3628559

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/text_generation_server/utils/weights.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def get_multi_weights_col(self, prefixes: List[str], quantize: str, dim: int):
130130
try:
131131
bits = self.get_tensor("gptq_bits").item()
132132
groupsize = self.get_tensor("gptq_groupsize").item()
133-
except SafetensorError as e:
133+
except (SafetensorError, RuntimeError) as e:
134134
try:
135135
import os
136136

@@ -159,7 +159,7 @@ def get_multi_weights_row(self, prefix: str, quantize: str):
159159
try:
160160
bits = self.get_tensor("gptq_bits").item()
161161
groupsize = self.get_tensor("gptq_groupsize").item()
162-
except SafetensorError as e:
162+
except (SafetensorError, RuntimeError) as e:
163163
try:
164164
import os
165165

0 commit comments

Comments
 (0)