Skip to content

Commit

Permalink
GPTQ Env vars: catch correct type of error (#596)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
ssmi153 authored Jul 12, 2023
1 parent f2f0289 commit 3628559
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/text_generation_server/utils/weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_multi_weights_col(self, prefixes: List[str], quantize: str, dim: int):
try:
bits = self.get_tensor("gptq_bits").item()
groupsize = self.get_tensor("gptq_groupsize").item()
except SafetensorError as e:
except (SafetensorError, RuntimeError) as e:
try:
import os

Expand Down Expand Up @@ -159,7 +159,7 @@ def get_multi_weights_row(self, prefix: str, quantize: str):
try:
bits = self.get_tensor("gptq_bits").item()
groupsize = self.get_tensor("gptq_groupsize").item()
except SafetensorError as e:
except (SafetensorError, RuntimeError) as e:
try:
import os

Expand Down

0 comments on commit 3628559

Please sign in to comment.