klemenk commited on
Commit
e0d03fd
·
verified ·
1 Parent(s): 271632e

Upload modeling_distilled_speech.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. modeling_distilled_speech.py +3 -1
modeling_distilled_speech.py CHANGED
@@ -80,7 +80,9 @@ class ConvLayer(nn.Module):
80
  )
81
 
82
  if norm == "group":
83
- self.norm = GroupNorm1D(num_groups=out_channels, num_channels=out_channels)
 
 
84
  elif norm == "layer":
85
  self.norm = nn.LayerNorm(out_channels)
86
  else:
 
80
  )
81
 
82
  if norm == "group":
83
+ # Use num_groups=1 (like LayerNorm over channels) for stability with short sequences
84
+ # This is what wav2vec2/HuBERT use
85
+ self.norm = GroupNorm1D(num_groups=1, num_channels=out_channels)
86
  elif norm == "layer":
87
  self.norm = nn.LayerNorm(out_channels)
88
  else: