Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aluminumbox committed Feb 10, 2025
1 parent b6d66ce commit f77c6a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cosyvoice/cli/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ def tts(self, text, flow_embedding, llm_embedding=torch.zeros(0, 192),
prompt_speech_feat=torch.zeros(1, 0, 80), stream=False, speed=1.0, **kwargs):
# this_uuid is used to track variables related to this inference thread
this_uuid = str(uuid.uuid1())
# NOTE flow model is only trained with static_chunk_size, so we need to trim flow prompt
n_chunk = int(flow_prompt_speech_token.size(1) / self.token_hop_len)
flow_prompt_speech_token = flow_prompt_speech_token[:, :n_chunk * self.token_hop_len]
prompt_speech_feat = prompt_speech_feat[:, :n_chunk * self.token_hop_len * 2]
with self.lock:
self.tts_speech_token_dict[this_uuid], self.llm_end_dict[this_uuid] = [], False
self.hift_cache_dict[this_uuid] = None
Expand Down

0 comments on commit f77c6a8

Please sign in to comment.