MCPcopy Create free account
hub / github.com/modelscope/FunASR / train

Method train

funasr/models/lora/layers.py:444–454  ·  view source on GitHub ↗

Train. Args: mode: TODO.

(self, mode: bool = True)

Source from the content-addressed store, hash-verified

442 nn.init.zeros_(self.lora_B)
443
444 def train(self, mode: bool = True):
445 """Train.
446
447 Args:
448 mode: TODO.
449 """
450 nn.Conv2d.train(self, mode)
451 if self.merge_weights and self.merged:
452 # Make sure that the weights are not merged
453 self.weight.data -= (self.lora_B @ self.lora_A).view(self.weight.shape) * self.scaling
454 self.merged = False
455
456 def eval(self):
457 """Eval."""

Callers

nothing calls this directly

Calls 1

trainMethod · 0.45

Tested by

no test coverage detected