Ram commited on
Commit ·
8fbc6e1
1
Parent(s): d132de8
Remove cache_source kwarg from HiFT inference in CosyVoiceModel
Browse files- cosyvoice/cli/model.py +2 -2
cosyvoice/cli/model.py
CHANGED
|
@@ -158,7 +158,7 @@ class CosyVoiceModel:
|
|
| 158 |
if finalize is False:
|
| 159 |
self.mel_overlap_dict[uuid] = tts_mel[:, :, -self.mel_overlap_len:]
|
| 160 |
tts_mel = tts_mel[:, :, :-self.mel_overlap_len]
|
| 161 |
-
tts_speech, tts_source = self.hift.inference(speech_feat=tts_mel
|
| 162 |
if self.hift_cache_dict[uuid] is not None:
|
| 163 |
tts_speech = fade_in_out(tts_speech, self.hift_cache_dict[uuid]['speech'], self.speech_window)
|
| 164 |
self.hift_cache_dict[uuid] = {'mel': tts_mel[:, :, -self.mel_cache_len:],
|
|
@@ -169,7 +169,7 @@ class CosyVoiceModel:
|
|
| 169 |
if speed != 1.0:
|
| 170 |
assert self.hift_cache_dict[uuid] is None, 'speed change only support non-stream inference mode'
|
| 171 |
tts_mel = F.interpolate(tts_mel, size=int(tts_mel.shape[2] / speed), mode='linear')
|
| 172 |
-
tts_speech, tts_source = self.hift.inference(speech_feat=tts_mel
|
| 173 |
if self.hift_cache_dict[uuid] is not None:
|
| 174 |
tts_speech = fade_in_out(tts_speech, self.hift_cache_dict[uuid]['speech'], self.speech_window)
|
| 175 |
return tts_speech
|
|
|
|
| 158 |
if finalize is False:
|
| 159 |
self.mel_overlap_dict[uuid] = tts_mel[:, :, -self.mel_overlap_len:]
|
| 160 |
tts_mel = tts_mel[:, :, :-self.mel_overlap_len]
|
| 161 |
+
tts_speech, tts_source = self.hift.inference(speech_feat=tts_mel)
|
| 162 |
if self.hift_cache_dict[uuid] is not None:
|
| 163 |
tts_speech = fade_in_out(tts_speech, self.hift_cache_dict[uuid]['speech'], self.speech_window)
|
| 164 |
self.hift_cache_dict[uuid] = {'mel': tts_mel[:, :, -self.mel_cache_len:],
|
|
|
|
| 169 |
if speed != 1.0:
|
| 170 |
assert self.hift_cache_dict[uuid] is None, 'speed change only support non-stream inference mode'
|
| 171 |
tts_mel = F.interpolate(tts_mel, size=int(tts_mel.shape[2] / speed), mode='linear')
|
| 172 |
+
tts_speech, tts_source = self.hift.inference(speech_feat=tts_mel)
|
| 173 |
if self.hift_cache_dict[uuid] is not None:
|
| 174 |
tts_speech = fade_in_out(tts_speech, self.hift_cache_dict[uuid]['speech'], self.speech_window)
|
| 175 |
return tts_speech
|