kevinwang676 commited on
Commit
58177cb
1 Parent(s): 27a6f13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -1,13 +1,9 @@
1
  import re, os
2
  import requests
3
  import json
 
4
 
5
- import urllib.request
6
- urllib.request.urlretrieve("https://download.openxlab.org.cn/repos/file/Kevin676/NeuCoSVC-2/main?filepath=WavLM-Large.pt&sign=971a42d686a15fcd3aafae29c1c97220&nonce=1715413418821", "ckpt/WavLM-Large.pt")
7
- urllib.request.urlretrieve("https://download.openxlab.org.cn/repos/file/Kevin676/NeuCoSVC-2/main?filepath=G_150k.pt&sign=07d507c87b7b9ed63556b7c094e6b0b5&nonce=1715413397933", "ckpt/G_150k.pt")
8
- urllib.request.urlretrieve("https://download.openxlab.org.cn/repos/file/Kevin676/NeuCoSVC-v2/main?filepath=speech_XXL_cond.zip&sign=0520b3273355818d1ebee030bce88ee4&nonce=1715413443250", "speech_XXL_cond.zip")
9
- urllib.request.urlretrieve("https://download.openxlab.org.cn/models/Kevin676/rvc-models/weight/UVR-HP2.pth", "uvr5/uvr_model/UVR-HP2.pth")
10
- urllib.request.urlretrieve("https://download.openxlab.org.cn/models/Kevin676/rvc-models/weight/UVR-HP5.pth", "uvr5/uvr_model/UVR-HP5.pth")
11
 
12
  import zipfile
13
  with zipfile.ZipFile("speech_XXL_cond.zip", 'r') as zip_ref:
@@ -86,14 +82,14 @@ func = AudioPre
86
  pre_fun_hp2 = func(
87
  agg=int(10),
88
  model_path=os.path.join(weight_uvr5_root, "UVR-HP2.pth"),
89
- device="cuda",
90
  is_half=True,
91
  )
92
 
93
  pre_fun_hp5 = func(
94
  agg=int(10),
95
  model_path=os.path.join(weight_uvr5_root, "UVR-HP5.pth"),
96
- device="cuda",
97
  is_half=True,
98
  )
99
 
 
1
  import re, os
2
  import requests
3
  import json
4
+ import torch
5
 
6
+ device = 'cuda' if torch.cuda.is_available() else 'cpu'
 
 
 
 
 
7
 
8
  import zipfile
9
  with zipfile.ZipFile("speech_XXL_cond.zip", 'r') as zip_ref:
 
82
  pre_fun_hp2 = func(
83
  agg=int(10),
84
  model_path=os.path.join(weight_uvr5_root, "UVR-HP2.pth"),
85
+ device=device,
86
  is_half=True,
87
  )
88
 
89
  pre_fun_hp5 = func(
90
  agg=int(10),
91
  model_path=os.path.join(weight_uvr5_root, "UVR-HP5.pth"),
92
+ device=device,
93
  is_half=True,
94
  )
95