MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / __init__

Method __init__

diffusers/examples/community/gluegen.py:79–99  ·  view source on GitHub ↗
(self, num_tok, dim, dim_out, mult=2)

Source from the content-addressed store, hash-verified

77
78class TranslatorBaseNoLN(nn.Module):
79 def __init__(self, num_tok, dim, dim_out, mult=2):
80 super().__init__()
81
82 self.dim_in = dim
83 self.dim_out = dim_out
84
85 self.net_tok = nn.Sequential(
86 nn.Linear(num_tok, int(num_tok * mult)),
87 nn.GELU(),
88 nn.Linear(int(num_tok * mult), int(num_tok * mult)),
89 nn.GELU(),
90 nn.Linear(int(num_tok * mult), num_tok),
91 )
92
93 self.net_sen = nn.Sequential(
94 nn.Linear(dim, int(dim * mult)),
95 nn.GELU(),
96 nn.Linear(int(dim * mult), int(dim * mult)),
97 nn.GELU(),
98 nn.Linear(int(dim * mult), dim_out),
99 )
100
101 def forward(self, x):
102 if self.dim_in == self.dim_out:

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected