mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
from local
This commit is contained in:
parent
383cb553f4
commit
016876a900
Binary file not shown.
@ -40,12 +40,7 @@ logger = logging.getLogger().setLevel(logging.INFO)
|
|||||||
class TransformerEncoderAdapter(TransformerEncoder):
|
class TransformerEncoderAdapter(TransformerEncoder):
|
||||||
def __init__(self, args: Wav2Vec2Config):
|
def __init__(self, args: Wav2Vec2Config):
|
||||||
super().__init__(args)
|
super().__init__(args)
|
||||||
self.adapters = ResidualAdapterModule(proj_dim=512)
|
self.lora = LoRAModule()
|
||||||
|
|
||||||
for p in self.adapters.parameters():
|
|
||||||
p.data /= 10.
|
|
||||||
#p.data = nn.Parameter(torch.zeros(p.size()).to('cuda'))
|
|
||||||
#p.data = nn.Parameter(torch.randn(p.size()).to('cuda')/20.)
|
|
||||||
|
|
||||||
def forward(self, x, padding_mask=None, layer=None, tgt_layer=None):
|
def forward(self, x, padding_mask=None, layer=None, tgt_layer=None):
|
||||||
x, layer_results = self.extract_features_with_adapter(
|
x, layer_results = self.extract_features_with_adapter(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user