Spaces:
Sleeping
Sleeping
Update app.py
Browse files153 unmodified lines15415515615715815916016116229 unmodified lines192193194195196197198199200201202203204205153 unmodified linespipe.load_components(dtype=torch.bfloat16)pipe.transformer.set_attention_backend(ATTENTION)pipe.load_components(dtype=torch.bfloat16)pipe.transformer.set_attention_backend(ATTENTION)# --- Diagnostic: dump the LoRA files' key names/shapes and the transformer's own shapes to the Space# logs, so the exact rename map can be worked out without a notebook or shell. Set H3_LORA_DEBUG=0 in# the Space's env vars to silence this once you're done, or just delete this block later.29 unmodified linesfor k, shape in sorted(norm_out.items()):print(f"[lora-debug] {k} {shape}", flush=True)if LORA_REPO.lower() not in ("", "off", "none"):from peft.tuners.tuners_utils import BaseTunerLayertry:counts = {}for name, filename in LORA_FILES.items():...# Approach B: attach both LoRA adapters as PEFT layers on the transformer, inactive (weight 0) until a# request asks for them. `load_lora_adapter` is the model-level loader (`PeftAdapterMixin`), used because# `MiniMaxH3ModularPipeline` has no pipeline-level `load_lora_weights` of its own.153 unmodified lines15415515615715815929 unmodified lines189190191192193194153 unmodified linespipe.load_components(dtype=torch.bfloat16)pipe.transformer.set_attention_backend(ATTENTION)# --- Diagnostic: dump the LoRA files' key names/shapes and the transformer's own shapes to the Space# logs, so the exact rename map can be worked out without a notebook or shell. Set H3_LORA_DEBUG=0 in# the Space's env vars to silence this once you're done, or just delete this block later.29 unmodified linesfor k, shape in sorted(norm_out.items()):print(f"[lora-debug] {k} {shape}", flush=True)# Approach B: attach both LoRA adapters as PEFT layers on the transformer, inactive (weight 0) until a# request asks for them. `load_lora_adapter` is the model-level loader (`PeftAdapterMixin`), used because# `MiniMaxH3ModularPipeline` has no pipeline-level `load_lora_weights` of its own.
app.py-11