Skip to content

Commit

Permalink
Fix bitsandbytes imports in unit tests on MacOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanJDick committed Dec 30, 2024
1 parent 477d87e commit 9a0a226
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import pytest
import torch

from invokeai.backend.model_manager.load.model_cache.torch_module_autocast.custom_modules.custom_invoke_linear_nf4 import (
CustomInvokeLinearNF4,
)
from invokeai.backend.model_manager.load.model_cache.torch_module_autocast.torch_module_autocast import (
wrap_custom_layer,
)
from invokeai.backend.quantization.bnb_nf4 import InvokeLinearNF4

if not torch.cuda.is_available():
pytest.skip("CUDA is not available", allow_module_level=True)
else:
from invokeai.backend.model_manager.load.model_cache.torch_module_autocast.custom_modules.custom_invoke_linear_nf4 import (
CustomInvokeLinearNF4,
)
from invokeai.backend.quantization.bnb_nf4 import InvokeLinearNF4


def build_linear_nf4_layer(orig_layer: torch.nn.Linear | None = None):
Expand Down

0 comments on commit 9a0a226

Please sign in to comment.