[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
cc36e4b535
commit
f0ec030fbc
2 changed files with 8 additions and 3 deletions
|
|
@ -56,14 +56,17 @@ if sys.platform == "win32":
|
|||
# before any import that pulls in bitsandbytes (mirrors worker.py logic).
|
||||
if "BNB_ROCM_VERSION" not in os.environ:
|
||||
import glob as _glob
|
||||
|
||||
_bnb_rocm_ver = None
|
||||
try:
|
||||
import importlib.util as _ilu
|
||||
|
||||
_bnb_spec = _ilu.find_spec("bitsandbytes")
|
||||
if _bnb_spec and _bnb_spec.origin:
|
||||
_pkg_dir = os.path.dirname(_bnb_spec.origin)
|
||||
_dlls = _glob.glob(os.path.join(_pkg_dir, "libbitsandbytes_rocm*.dll"))
|
||||
import re as _re_bnb
|
||||
|
||||
for _dll in sorted(_dlls):
|
||||
_m = _re_bnb.search(r"libbitsandbytes_rocm(\d+)\.dll", _dll)
|
||||
if _m:
|
||||
|
|
|
|||
|
|
@ -2352,8 +2352,10 @@ class TestSetupShGccInstallDir:
|
|||
# TEST: main.py -- BNB_ROCM_VERSION server startup + distributed stubs
|
||||
# =============================================================================
|
||||
|
||||
_MAIN_PY_PATH = PACKAGE_ROOT / "studio" / "backend" / "main.py"
|
||||
_HARDWARE_PY_PATH = PACKAGE_ROOT / "studio" / "backend" / "utils" / "hardware" / "hardware.py"
|
||||
_MAIN_PY_PATH = PACKAGE_ROOT / "studio" / "backend" / "main.py"
|
||||
_HARDWARE_PY_PATH = (
|
||||
PACKAGE_ROOT / "studio" / "backend" / "utils" / "hardware" / "hardware.py"
|
||||
)
|
||||
|
||||
|
||||
class TestServerStartupRocmFixes:
|
||||
|
|
@ -2371,7 +2373,7 @@ class TestServerStartupRocmFixes:
|
|||
"""main.py BNB_ROCM_VERSION logic must be inside the win32 platform guard."""
|
||||
source = _MAIN_PY_PATH.read_text(encoding = "utf-8")
|
||||
win32_idx = source.find('sys.platform == "win32"')
|
||||
bnb_idx = source.find("BNB_ROCM_VERSION")
|
||||
bnb_idx = source.find("BNB_ROCM_VERSION")
|
||||
assert win32_idx != -1 and bnb_idx != -1
|
||||
assert win32_idx < bnb_idx
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue