add import_utils

This commit is contained in:
younesbelkada
2023-04-03 16:30:08 +00:00
parent 8058709d5a
commit 519c07fb00
4 changed files with 22 additions and 11 deletions
+1 -5
View File
@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import gc
import importlib
import unittest
import pytest
@@ -21,14 +20,11 @@ import torch
from transformers import AutoModelForCausalLM, AutoModelForSeq2SeqLM, AutoTokenizer, WhisperForConditionalGeneration
from peft import LoraConfig, PeftModel, get_peft_model
from peft.utils import is_bnb_available
from .testing_utils import require_bitsandbytes, require_torch_gpu, require_torch_multi_gpu
def is_bnb_available():
return importlib.util.find_spec("bitsandbytes") is not None
if is_bnb_available():
from peft.tuners.lora import Linear8bitLt