CosyVoice commited on
Commit
e141634
1 Parent(s): 11eacb8

remove unnecessary code

Browse files
cosyvoice/flow/flow.py CHANGED
@@ -113,7 +113,7 @@ class MaskedDiffWithXvec(torch.nn.Module):
113
  # concat text and prompt_text
114
  token_len1, token_len2 = prompt_token.shape[1], token.shape[1]
115
  token, token_len = torch.concat([prompt_token, token], dim=1), prompt_token_len + token_len
116
- mask = (~make_pad_mask(token_len)).to(embedding.dtype).unsqueeze(-1).to(embedding)
117
  token = self.input_embedding(torch.clamp(token, min=0)) * mask
118
 
119
  # text encode
 
113
  # concat text and prompt_text
114
  token_len1, token_len2 = prompt_token.shape[1], token.shape[1]
115
  token, token_len = torch.concat([prompt_token, token], dim=1), prompt_token_len + token_len
116
+ mask = (~make_pad_mask(token_len)).unsqueeze(-1).to(embedding)
117
  token = self.input_embedding(torch.clamp(token, min=0)) * mask
118
 
119
  # text encode
cosyvoice/flow/flow_matching.py CHANGED
@@ -14,8 +14,6 @@
14
  import torch
15
  import torch.nn.functional as F
16
  from matcha.models.components.flow_matching import BASECFM
17
- import onnxruntime as ort
18
- import numpy as np
19
 
20
  class ConditionalCFM(BASECFM):
21
  def __init__(self, in_channels, cfm_params, n_spks=1, spk_emb_dim=64, estimator: torch.nn.Module = None):
 
14
  import torch
15
  import torch.nn.functional as F
16
  from matcha.models.components.flow_matching import BASECFM
 
 
17
 
18
  class ConditionalCFM(BASECFM):
19
  def __init__(self, in_channels, cfm_params, n_spks=1, spk_emb_dim=64, estimator: torch.nn.Module = None):