J Z commited on
Update tts.py
Browse files
tts.py
CHANGED
|
@@ -209,6 +209,9 @@ def _encode_reference_audio(ref_path):
|
|
| 209 |
waveform = waveform.to(dtype=torch.float32)
|
| 210 |
waveform = waveform.unsqueeze(0)
|
| 211 |
|
|
|
|
|
|
|
|
|
|
| 212 |
with torch.inference_mode():
|
| 213 |
codes = _snac_model.encode(waveform)
|
| 214 |
|
|
|
|
| 209 |
waveform = waveform.to(dtype=torch.float32)
|
| 210 |
waveform = waveform.unsqueeze(0)
|
| 211 |
|
| 212 |
+
if torch.cuda.is_available():
|
| 213 |
+
waveform = waveform.cuda()
|
| 214 |
+
|
| 215 |
with torch.inference_mode():
|
| 216 |
codes = _snac_model.encode(waveform)
|
| 217 |
|