Spaces:
Running
on
T4
Running
on
T4
Commit
•
c626da3
1
Parent(s):
4eac766
Update app.py
Browse files
app.py
CHANGED
@@ -75,7 +75,8 @@ def tts(text,
|
|
75 |
audio, sample_rate = torchaudio.load(prompt)
|
76 |
|
77 |
# support only single channel
|
78 |
-
|
|
|
79 |
# Resampling
|
80 |
if sample_rate != 16000:
|
81 |
audio = torchaudio.functional.resample(audio, sample_rate, 16000, resampling_method="kaiser_window")
|
|
|
75 |
audio, sample_rate = torchaudio.load(prompt)
|
76 |
|
77 |
# support only single channel
|
78 |
+
if audio.shape[0] != 1:
|
79 |
+
audio = audio[:1,:]
|
80 |
# Resampling
|
81 |
if sample_rate != 16000:
|
82 |
audio = torchaudio.functional.resample(audio, sample_rate, 16000, resampling_method="kaiser_window")
|