Unverified Commit 36285595 authored by ssmi153's avatar ssmi153 Committed by GitHub
Browse files

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.
parent f2f0289f
......@@ -130,7 +130,7 @@ class Weights:
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
......@@ -159,7 +159,7 @@ class Weights:
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
......
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