Spaces:
Sleeping
Sleeping
updated requirements
Browse files
app.py
CHANGED
@@ -132,7 +132,7 @@ def make_npz_prompt(name, uploaded_audio, recorded_audio, transcript_content):
|
|
132 |
if wav_pr.abs().max() > 1:
|
133 |
wav_pr /= wav_pr.abs().max()
|
134 |
if wav_pr.size(-1) == 2:
|
135 |
-
wav_pr = wav_pr
|
136 |
if wav_pr.ndim == 1:
|
137 |
wav_pr = wav_pr.unsqueeze(0)
|
138 |
assert wav_pr.ndim and wav_pr.size(0) == 1
|
@@ -204,7 +204,7 @@ def infer_from_audio(text, language, accent, audio_prompt, record_audio_prompt,
|
|
204 |
if wav_pr.abs().max() > 1:
|
205 |
wav_pr /= wav_pr.abs().max()
|
206 |
if wav_pr.size(-1) == 2:
|
207 |
-
wav_pr = wav_pr
|
208 |
if wav_pr.ndim == 1:
|
209 |
wav_pr = wav_pr.unsqueeze(0)
|
210 |
assert wav_pr.ndim and wav_pr.size(0) == 1
|
|
|
132 |
if wav_pr.abs().max() > 1:
|
133 |
wav_pr /= wav_pr.abs().max()
|
134 |
if wav_pr.size(-1) == 2:
|
135 |
+
wav_pr = wav_pr[:, 0]
|
136 |
if wav_pr.ndim == 1:
|
137 |
wav_pr = wav_pr.unsqueeze(0)
|
138 |
assert wav_pr.ndim and wav_pr.size(0) == 1
|
|
|
204 |
if wav_pr.abs().max() > 1:
|
205 |
wav_pr /= wav_pr.abs().max()
|
206 |
if wav_pr.size(-1) == 2:
|
207 |
+
wav_pr = wav_pr[:, 0]
|
208 |
if wav_pr.ndim == 1:
|
209 |
wav_pr = wav_pr.unsqueeze(0)
|
210 |
assert wav_pr.ndim and wav_pr.size(0) == 1
|