mirror of
https://github.com/wassname/peft.git
synced 2026-09-11 12:30:16 +08:00
add import_utils
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user