ok so if we're using a swiglu for TTS head... there's two ways i see: 1. hand it…
- User
ok so if we're using a swiglu for TTS head... there's two ways i see:
- hand it concatenated output [shared, cond_up] and use the traditional SwiGLU logic:
class SwiGLU(nn.Module): def __init__(self, d_in, d_hidden, d_out, beta=True): super().__init__() self.w1 = nn.Linear(d_in, d_hidden, bias=False) self.w2 = nn.Linear(d_hidden, d_out, bias=False) self.w3 = nn.Linear(d_in, d_hidden, bias=False) self.act = Swish() if beta else nn.SiLU() def forward(self, x): gate = self.act(self.w1(x)) return self.w2(gate * self.w3(x)) x = self.tts_head_swiglu(torch.cat([shared, cond_up]))- use a modified 'gate swiglu'
class GateSwiGLU(nn.Module): def __init__(self, d_in, d_gate, d_hidden, d_out, beta=True): super().__init__() self.w1 = nn.Linear(d_gate, d_hidden, bias=False) self.w2 = nn.Linear(d_hidden, d_out, bias=False) self.w3 = nn.Linear(d_in, d_hidden, bias=False) self.act = Swish() if beta else nn.SiLU() def forward(self, x, gate): gate = self.act(self.w1(gate)) return self.w2(gate * self.w3(x)) x = self.tts_head_gate_swiglu(shared, cond_up)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.