diff --git a/models/minimax_h3/lora_affine.py b/models/minimax_h3/lora_affine.py index 008d96f9e..b1d3e42b0 100644 --- a/models/minimax_h3/lora_affine.py +++ b/models/minimax_h3/lora_affine.py @@ -69,7 +69,7 @@ def _aligned_affine_map(architecture, target_table): if int(fit.rank) != target_h.shape[1]: raise ValueError(f"MiniMax H3 {architecture} checkpoint has a rank-deficient AdaLN table") relative_error = torch.linalg.vector_norm(target_h @ fit.solution - canonical_h) / torch.linalg.vector_norm(canonical_h) - if relative_error > 1e-5: + if relative_error > 1e-4: raise ValueError(f"MiniMax H3 {architecture} checkpoint AdaLN table is incompatible with the canonical LoRA map (relative error {relative_error:.3g})") return (fit.solution @ canonical_affine.double()).float() diff --git a/wgp.py b/wgp.py index b2c7dbb0b..e2b223bc8 100644 --- a/wgp.py +++ b/wgp.py @@ -13558,6 +13558,39 @@ def create_ui(): if isinstance(plugin_js, str) and plugin_js.strip(): js += f"\n{plugin_js}\n" js += """ + (() => { + let timer = null; + function sync() { + const el = document.querySelector('#wangp_main_output_trigger textarea, #wangp_main_output_trigger input'); + if (el) { + el.value = String(Date.now()); + el.dispatchEvent(new Event('input', { bubbles: true })); + } + } + function startSync() { + sync(); + if (!timer) { + timer = setInterval(() => { + const abortBtn = Array.from(document.querySelectorAll('button')).find(b => b.textContent.trim() === 'Abort'); + if (abortBtn && abortBtn.offsetParent !== null) { + sync(); + } else { + clearInterval(timer); + timer = null; + setTimeout(sync, 500); + } + }, 2000); + } + } + window.addEventListener('unhandledrejection', (e) => { + if (String(e.reason || '').includes('Connection errored out')) { + e.preventDefault(); + startSync(); + } + }); + window.addEventListener('offline', startSync); + window.addEventListener('online', startSync); + })(); } """ if server_config.get("display_stats", 0) == 1: