4141 f"Please restructure your imports with 'import unsloth' at the top of your file." ,
4242 stacklevel = 2 ,
4343 )
44- pass
4544
4645# Unsloth currently does not work on multi GPU setups - sadly we are a 2 brother team so
4746# enabling it will require much more work, so we have to prioritize. Please understand!
6867 )
6968except Exception as exception :
7069 raise exception
71- pass
7270
7371import importlib .util
7472from pathlib import Path
9795 raise ImportError (
9896 f"Unsloth: Please install unsloth_zoo via `pip install unsloth_zoo` Also error = { str (e )} "
9997 )
100- pass
10198
10299from unsloth_zoo .device_type import (
103100 is_hip ,
@@ -147,14 +144,12 @@ def is_bf16_supported():
147144 return SUPPORTS_BFLOAT16
148145
149146 torch .cuda .is_bf16_supported = is_bf16_supported
150- pass
151147elif DEVICE_TYPE == "hip" :
152148 SUPPORTS_BFLOAT16 = torch .cuda .is_bf16_supported ()
153149elif DEVICE_TYPE == "xpu" :
154150 # torch.xpu.is_bf16_supported() does not have including_emulation
155151 # set SUPPORTS_BFLOAT16 as torch.xpu.is_bf16_supported()
156152 SUPPORTS_BFLOAT16 = torch .xpu .is_bf16_supported ()
157- pass
158153
159154# For Gradio HF Spaces?
160155# if "SPACE_AUTHOR_NAME" not in os.environ and "SPACE_REPO_NAME" not in os.environ:
@@ -206,7 +201,6 @@ def is_bf16_supported():
206201 )[::- 1 ][0 ]
207202 latest_cuda = possible_cudas [latest_cuda ]
208203 os .system (f"ldconfig /usr/local/{ latest_cuda } " )
209- pass
210204
211205 importlib .reload (bnb )
212206 importlib .reload (triton )
@@ -230,15 +224,13 @@ def is_bf16_supported():
230224 "Also try `sudo ldconfig /usr/local/cuda-xx.x` - find the latest cuda version.\n "
231225 "Unsloth will still run for now, but maybe it might crash - let's hope it works!"
232226 )
233- pass
234227elif DEVICE_TYPE == "hip" :
235228 # NO-OP for rocm device
236229 pass
237230elif DEVICE_TYPE == "xpu" :
238231 import bitsandbytes as bnb
239232
240233 # TODO: check triton for intel installed properly.
241- pass
242234
243235from .models import *
244236from .models import __version__
0 commit comments