From 40967f29e08bd5d7132418a2f672936ab2bcdeb6 Mon Sep 17 00:00:00 2001 From: Ella Charlaix Date: Tue, 5 Nov 2024 10:20:14 +0100 Subject: [PATCH] style --- optimum/gptq/data.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/optimum/gptq/data.py b/optimum/gptq/data.py index 7b472e7efdf..7e5fc0b43db 100644 --- a/optimum/gptq/data.py +++ b/optimum/gptq/data.py @@ -18,7 +18,8 @@ import numpy as np import torch -from optimum.utils.import_utils import is_datasets_available, DATASETS_IMPORT_ERROR + +from optimum.utils.import_utils import DATASETS_IMPORT_ERROR, is_datasets_available if is_datasets_available(): @@ -117,7 +118,6 @@ def pad_block(block, pads): def get_wikitext2(tokenizer: Any, seqlen: int, nsamples: int, split: str = "train"): - if not is_datasets_available(): raise ImportError(DATASETS_IMPORT_ERROR.format("get_wikitext2")) @@ -168,7 +168,6 @@ def get_c4(tokenizer: Any, seqlen: int, nsamples: int, split: str = "train"): def get_c4_new(tokenizer: Any, seqlen: int, nsamples: int, split: str = "train"): - if not is_datasets_available(): raise ImportError(DATASETS_IMPORT_ERROR.format("get_c4_new"))