Skip to content

Commit

Permalink
Ruff fix
Browse files Browse the repository at this point in the history
  • Loading branch information
elvircrn committed Dec 9, 2024
1 parent 62bd86b commit efd9f20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/transformers/integrations/spqr.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# limitations under the License.
"SpQR (Sparse-Quantized Representation) integration file"

from ..utils import is_torch_available, is_spqr_available, is_accelerate_available
from ..utils import is_accelerate_available, is_spqr_available, is_torch_available


if is_torch_available():
import torch.nn as nn
Expand Down
4 changes: 1 addition & 3 deletions src/transformers/quantizers/quantizer_spqr.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ def validate_environment(self, *args, **kwargs):
def update_torch_dtype(self, torch_dtype: "torch.dtype") -> "torch.dtype":
if torch_dtype is None:
torch_dtype = torch.float16
logger.info(
"Assuming SpQR inference on GPU and loading the model in `torch.float16`."
)
logger.info("Assuming SpQR inference on GPU and loading the model in `torch.float16`.")
elif torch_dtype != torch.float16:
raise ValueError(
"You cannot use any type other than torch.float16 for SpQR. Please either leave it None or set it to"
Expand Down

0 comments on commit efd9f20

Please sign in to comment.