소스 검색

Disable neft on eval

Lengyue 2 년 전
부모
커밋
415c78a7d4
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      fish_speech/models/text2semantic/llama.py

+ 1 - 1
fish_speech/models/text2semantic/llama.py

@@ -166,7 +166,7 @@ class Transformer(nn.Module):
         x = torch.stack(vocab_embeds, dim=3)
         x = x.sum(dim=3)
 
-        if self.config.neft_alpha > 0:
+        if self.config.neft_alpha > 0 and self.training:
             # alpha / sqrt(L * D)
             scaled_alpha = self.config.neft_alpha / math.sqrt(
                 self.config.dim * x.shape[2]