Update app.py
Browse files
app.py
CHANGED
|
@@ -96,13 +96,8 @@ def synthesize_speech(text, ref_audio, ref_text):
|
|
| 96 |
sf.write(temp_audio.name, audio_data, samplerate=sample_rate, format='WAV')
|
| 97 |
temp_audio.flush()
|
| 98 |
|
| 99 |
-
#
|
| 100 |
-
|
| 101 |
-
wav = torch.from_numpy(wav).float()
|
| 102 |
-
if sr != 24000:
|
| 103 |
-
wav = torchaudio.functional.resample(wav, sr, 24000)
|
| 104 |
-
# Feed tensor directly to model – never touches torchaudio.load
|
| 105 |
-
out = model(text, ref_audio=wav.unsqueeze(0), ref_text=ref_text)
|
| 106 |
|
| 107 |
# Normalize output and save
|
| 108 |
if out.dtype == np.int16:
|
|
|
|
| 96 |
sf.write(temp_audio.name, audio_data, samplerate=sample_rate, format='WAV')
|
| 97 |
temp_audio.flush()
|
| 98 |
|
| 99 |
+
# Use the **original** signature – never change it
|
| 100 |
+
out = model(text, ref_audio_path=temp_audio.name, ref_text=ref_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
# Normalize output and save
|
| 103 |
if out.dtype == np.int16:
|