Update app.py
Browse files
app.py
CHANGED
|
@@ -156,7 +156,10 @@ def evaluate(
|
|
| 156 |
|
| 157 |
# tts.tts_to_file(output.split("### Response:")[1].strip(), speaker_wav = upload, language="en", file_path="output.wav")
|
| 158 |
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
voicefixer.restore(input="output.wav", # input wav file path
|
| 162 |
output="audio1.wav", # output wav file path
|
|
@@ -170,7 +173,7 @@ def evaluate(
|
|
| 170 |
enhanced = enhance_model.enhance_batch(noisy, lengths=torch.tensor([1.]))
|
| 171 |
torchaudio.save("enhanced.wav", enhanced.cpu(), 16000)
|
| 172 |
|
| 173 |
-
return [result.text,
|
| 174 |
|
| 175 |
|
| 176 |
c1 = gr.Interface(
|
|
|
|
| 156 |
|
| 157 |
# tts.tts_to_file(output.split("### Response:")[1].strip(), speaker_wav = upload, language="en", file_path="output.wav")
|
| 158 |
|
| 159 |
+
output1 = output.split("### Response:")[1].strip()
|
| 160 |
+
output2 = output.split("### Instruction:")[0].strip()
|
| 161 |
+
|
| 162 |
+
tts.tts_to_file(output2, speaker_wav = upload, language="en", file_path="output.wav")
|
| 163 |
|
| 164 |
voicefixer.restore(input="output.wav", # input wav file path
|
| 165 |
output="audio1.wav", # output wav file path
|
|
|
|
| 173 |
enhanced = enhance_model.enhance_batch(noisy, lengths=torch.tensor([1.]))
|
| 174 |
torchaudio.save("enhanced.wav", enhanced.cpu(), 16000)
|
| 175 |
|
| 176 |
+
return [result.text, output2, "enhanced.wav"]
|
| 177 |
|
| 178 |
|
| 179 |
c1 = gr.Interface(
|