Kevin676 commited on
Commit
f6d6c77
1 Parent(s): e0bd5ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -13,6 +13,22 @@ title1 = "RWKV-4-Raven-7B-v8-Eng-20230408-ctx4096"
13
  os.environ["RWKV_JIT_ON"] = '1'
14
  os.environ["RWKV_CUDA_ON"] = '1' # if '1' then use CUDA kernel for seq mode (much faster)
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  from rwkv.model import RWKV
17
  model_path = hf_hub_download(repo_id="BlinkDL/rwkv-4-raven", filename=f"{title1}.pth")
18
  model = RWKV(model=model_path, strategy='cuda fp16i8 *8 -> cuda fp16')
 
13
  os.environ["RWKV_JIT_ON"] = '1'
14
  os.environ["RWKV_CUDA_ON"] = '1' # if '1' then use CUDA kernel for seq mode (much faster)
15
 
16
+ os.system('pip install voicefixer --upgrade')
17
+ from voicefixer import VoiceFixer
18
+ voicefixer = VoiceFixer()
19
+
20
+ from TTS.api import TTS
21
+ tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False, gpu=True)
22
+
23
+ import torchaudio
24
+ from speechbrain.pretrained import SpectralMaskEnhancement
25
+
26
+ enhance_model = SpectralMaskEnhancement.from_hparams(
27
+ source="speechbrain/metricgan-plus-voicebank",
28
+ savedir="pretrained_models/metricgan-plus-voicebank",
29
+ run_opts={"device":"cuda"},
30
+ )
31
+
32
  from rwkv.model import RWKV
33
  model_path = hf_hub_download(repo_id="BlinkDL/rwkv-4-raven", filename=f"{title1}.pth")
34
  model = RWKV(model=model_path, strategy='cuda fp16i8 *8 -> cuda fp16')