Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
@@ -175,7 +175,7 @@ def greet(apikey,Voicetoclone,VoiceMicrophone, audio, choice1):
|
|
175 |
|
176 |
messages.append({"role": "assistant", "content": chat_response})
|
177 |
|
178 |
-
text=
|
179 |
if Voicetoclone is not None:
|
180 |
reference_files= "%s" % (Voicetoclone)
|
181 |
print("path url")
|
@@ -226,21 +226,21 @@ def greet(apikey,Voicetoclone,VoiceMicrophone, audio, choice1):
|
|
226 |
print(" > Saving output to {}".format(out_path))
|
227 |
ap.save_wav(wav, out_path)
|
228 |
|
229 |
-
voicefixer.restore(input=out_path, # input wav file path
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
|
234 |
|
235 |
|
236 |
-
noisy = enhance_model.load_audio(
|
237 |
-
|
238 |
-
|
239 |
|
240 |
-
enhanced = enhance_model.enhance_batch(noisy, lengths=torch.tensor([1.]))
|
241 |
-
torchaudio.save("enhanced.wav", enhanced.cpu(), 16000)
|
242 |
|
243 |
-
return [result.text, chat_response,
|
244 |
|
245 |
output_1 = gr.Textbox(label="Speech to Text")
|
246 |
output_2 = gr.Textbox(label="ChatGPT Output")
|
|
|
175 |
|
176 |
messages.append({"role": "assistant", "content": chat_response})
|
177 |
|
178 |
+
text = chat_response
|
179 |
if Voicetoclone is not None:
|
180 |
reference_files= "%s" % (Voicetoclone)
|
181 |
print("path url")
|
|
|
226 |
print(" > Saving output to {}".format(out_path))
|
227 |
ap.save_wav(wav, out_path)
|
228 |
|
229 |
+
# voicefixer.restore(input=out_path, # input wav file path
|
230 |
+
# output="audio1.wav", # output wav file path
|
231 |
+
# cuda=True, # whether to use gpu acceleration
|
232 |
+
# mode = 0) # You can try out mode 0, 1 to find out the best result
|
233 |
|
234 |
|
235 |
|
236 |
+
# noisy = enhance_model.load_audio(
|
237 |
+
# "audio1.wav"
|
238 |
+
# ).unsqueeze(0)
|
239 |
|
240 |
+
# enhanced = enhance_model.enhance_batch(noisy, lengths=torch.tensor([1.]))
|
241 |
+
# torchaudio.save("enhanced.wav", enhanced.cpu(), 16000)
|
242 |
|
243 |
+
return [result.text, chat_response, out_path]
|
244 |
|
245 |
output_1 = gr.Textbox(label="Speech to Text")
|
246 |
output_2 = gr.Textbox(label="ChatGPT Output")
|