mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-18 10:20:16 +08:00
Update rmsnorm.py (Ensuring eps is not None)
This commit is contained in:
parent
634c398fd5
commit
080b5d0df4
@ -12,6 +12,10 @@ except:
|
|||||||
|
|
||||||
|
|
||||||
def rms_norm(x, weight=None, eps=1e-6):
|
def rms_norm(x, weight=None, eps=1e-6):
|
||||||
|
|
||||||
|
if eps is None: # Ensure eps is not None
|
||||||
|
eps = 1e-6
|
||||||
|
|
||||||
if rms_norm_torch is not None and not (torch.jit.is_tracing() or torch.jit.is_scripting()):
|
if rms_norm_torch is not None and not (torch.jit.is_tracing() or torch.jit.is_scripting()):
|
||||||
if weight is None:
|
if weight is None:
|
||||||
return rms_norm_torch(x, (x.shape[-1],), eps=eps)
|
return rms_norm_torch(x, (x.shape[-1],), eps=eps)
|
||||||
@ -30,7 +34,7 @@ if RMSNorm is None:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
normalized_shape,
|
normalized_shape,
|
||||||
eps=None,
|
eps=1e-6, # Changed default from None to 1e-6
|
||||||
elementwise_affine=True,
|
elementwise_affine=True,
|
||||||
device=None,
|
device=None,
|
||||||
dtype=None,
|
dtype=None,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user