Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,12 +40,8 @@ from scipy.io import wavfile
|
|
| 40 |
|
| 41 |
import subprocess
|
| 42 |
|
| 43 |
-
os.system(pip install -U numpy==1.21)
|
| 44 |
-
from TTS.api import TTS
|
| 45 |
-
tts = TTS(model_name="tts_models/zh-CN/baker/tacotron2-DDC-GST", progress_bar=False, gpu=True)
|
| 46 |
-
|
| 47 |
import whisper
|
| 48 |
-
model = whisper.load_model("
|
| 49 |
os.system('pip install voicefixer --upgrade')
|
| 50 |
from voicefixer import VoiceFixer
|
| 51 |
voicefixer = VoiceFixer()
|
|
@@ -53,6 +49,10 @@ import openai
|
|
| 53 |
import torchaudio
|
| 54 |
from speechbrain.pretrained import SpectralMaskEnhancement
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
enhance_model = SpectralMaskEnhancement.from_hparams(
|
| 57 |
source="speechbrain/metricgan-plus-voicebank",
|
| 58 |
savedir="pretrained_models/metricgan-plus-voicebank",
|
|
@@ -194,9 +194,6 @@ def voice_conversion(apikey, ta, audio, choice1):
|
|
| 194 |
|
| 195 |
messages.append({"role": "assistant", "content": chat_response})
|
| 196 |
|
| 197 |
-
tts = gTTS(chat_response, lang='zh-CN')
|
| 198 |
-
tts.save("output.wav")
|
| 199 |
-
|
| 200 |
tts.tts_to_file(chat_response + "。", file_path="output.wav")
|
| 201 |
|
| 202 |
target_audio = 'target.wav'
|
|
|
|
| 40 |
|
| 41 |
import subprocess
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
import whisper
|
| 44 |
+
model = whisper.load_model("base")
|
| 45 |
os.system('pip install voicefixer --upgrade')
|
| 46 |
from voicefixer import VoiceFixer
|
| 47 |
voicefixer = VoiceFixer()
|
|
|
|
| 49 |
import torchaudio
|
| 50 |
from speechbrain.pretrained import SpectralMaskEnhancement
|
| 51 |
|
| 52 |
+
os.system('pip install -U numpy==1.21')
|
| 53 |
+
from TTS.api import TTS
|
| 54 |
+
tts = TTS(model_name="tts_models/zh-CN/baker/tacotron2-DDC-GST", progress_bar=False, gpu=True)
|
| 55 |
+
|
| 56 |
enhance_model = SpectralMaskEnhancement.from_hparams(
|
| 57 |
source="speechbrain/metricgan-plus-voicebank",
|
| 58 |
savedir="pretrained_models/metricgan-plus-voicebank",
|
|
|
|
| 194 |
|
| 195 |
messages.append({"role": "assistant", "content": chat_response})
|
| 196 |
|
|
|
|
|
|
|
|
|
|
| 197 |
tts.tts_to_file(chat_response + "。", file_path="output.wav")
|
| 198 |
|
| 199 |
target_audio = 'target.wav'
|