From bfa0e33294f2b1dc25e65a33be2397f989824298 Mon Sep 17 00:00:00 2001 From: Titus von Koeller Date: Mon, 1 Aug 2022 03:31:48 -0700 Subject: ran black and isort for coherent code formatting --- bitsandbytes/cextension.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'bitsandbytes/cextension.py') diff --git a/bitsandbytes/cextension.py b/bitsandbytes/cextension.py index 4bc7bf7..bc11474 100644 --- a/bitsandbytes/cextension.py +++ b/bitsandbytes/cextension.py @@ -1,6 +1,7 @@ import ctypes as ct import os from warnings import warn + from bitsandbytes.cuda_setup import evaluate_cuda_setup @@ -8,17 +9,21 @@ class CUDALibrary_Singleton(object): _instance = None def __init__(self): - raise RuntimeError('Call get_instance() instead') + raise RuntimeError("Call get_instance() instead") def initialize(self): self.context = {} binary_name = evaluate_cuda_setup() - if not os.path.exists(os.path.dirname(__file__) + f'/{binary_name}'): - print(f'TODO: compile library for specific version: {binary_name}') - print('defaulting to libbitsandbytes.so') - self.lib = ct.cdll.LoadLibrary(os.path.dirname(__file__) + '/libbitsandbytes.so') + if not os.path.exists(os.path.dirname(__file__) + f"/{binary_name}"): + print(f"TODO: compile library for specific version: {binary_name}") + print("defaulting to libbitsandbytes.so") + self.lib = ct.cdll.LoadLibrary( + os.path.dirname(__file__) + "/libbitsandbytes.so" + ) else: - self.lib = ct.cdll.LoadLibrary(os.path.dirname(__file__) + f'/{binary_name}') + self.lib = ct.cdll.LoadLibrary( + os.path.dirname(__file__) + f"/{binary_name}" + ) @classmethod def get_instance(cls): @@ -35,6 +40,8 @@ try: lib.get_cusparse.restype = ct.c_void_p COMPILED_WITH_CUDA = True except AttributeError: - warn("The installed version of bitsandbytes was compiled without GPU support. " - "8-bit optimizers and GPU quantization are unavailable.") + warn( + "The installed version of bitsandbytes was compiled without GPU support. " + "8-bit optimizers and GPU quantization are unavailable." + ) COMPILED_WITH_CUDA = False -- cgit v1.2.3