Spaces:
Running on Zero
Running on Zero
temporary: LoRA scale 1.0 test
Browse files26 unmodified lines2728293031323326 unmodified linessys.path.insert(0, os.path.join(_path, "code"))from ndd.engine.requests import normalize # noqa: E402from ndd.engine.server import load # noqa: E402engine = load(_path, device="cpu") # ZeroGPU: build and merge on the CPU, then move the model to the GPUengine.m.to("cuda"); engine.m.device = "cuda"except Exception as e: # no secret / no access: the page still renders, runs report the problemimport traceback26 unmodified lines2728293031323334353637383926 unmodified linessys.path.insert(0, os.path.join(_path, "code"))from ndd.engine.requests import normalize # noqa: E402from ndd.engine.server import load # noqa: E402import tempfile, json as _j # TEMPORARY TEST: serve at LoRA scale 1.0_d = tempfile.mkdtemp()for _f in ("lora", "heads.pt"):os.symlink(os.path.join(_path, _f), os.path.join(_d, _f))_c = _j.load(open(os.path.join(_path, "calibration.json"))); _c["lora_scale"] = 1.0_j.dump(_c, open(os.path.join(_d, "calibration.json"), "w"))engine = load(_d, device="cpu")engine.m.to("cuda"); engine.m.device = "cuda"except Exception as e: # no secret / no access: the page still renders, runs report the problemimport traceback
app.py+7-1