Nick088 commited on
Commit
e4dcb8d
·
verified ·
1 Parent(s): 10cde96

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +49 -0
app.py ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import subprocess
2
+ import os
3
+ import torch
4
+
5
+
6
+ if torch.cuda.is_available():
7
+ print("Using GPU")
8
+ else:
9
+ print("Using CPU")
10
+
11
+
12
+ # Clone the repository
13
+ subprocess.run(["git", "clone", "https://github.com/TheStingerX/Ilaria-RVC-Mainline"], check=True)
14
+
15
+
16
+ # chande directory
17
+ os.chdir("Ilaria-RVC-Mainline")
18
+
19
+
20
+ # Download the Pretrains
21
+ def download_file(url, output_path):
22
+ subprocess.run(["aria2c", "--console-log-level=error", "-c", "-x", "16", "-s", "16", "-k", "1M", url, "-d", output_path], check=True)
23
+
24
+ # Example usage:
25
+ base_url = "https://huggingface.co/lj1995/{e}/resolve/main/pretrained_v2/"
26
+ output_directory = "/content/Ilaria-RVC-Mainline/assets/pretrained_v2"
27
+
28
+ files = [
29
+ "D32k.pth", "D40k.pth", "D48k.pth",
30
+ "G32k.pth", "G40k.pth", "G48k.pth",
31
+ "f0D32k.pth", "f0D40k.pth", "f0D48k.pth", "f0G32k.pth"
32
+ ]
33
+
34
+ for file in files:
35
+ url = base_url + file
36
+ download_file(url, output_directory)
37
+
38
+
39
+ urllib.request.urlretrieve("https://raw.githubusercontent.com/poiqazwsx/Ilaria-RVC-Mainline/main/infer/lib/audio.py", "/content/Ilaria-RVC-Mainline/infer/lib/audio.py")
40
+ print("File replaced successfully.")
41
+ os.mkdir("/content/Ilaria-RVC-Mainline/assets/weights")
42
+ os.mkdir("/content/Ilaria-RVC-Mainline/dataset")
43
+ os.mkdir("/content/Ilaria-RVC-Mainline/audios)
44
+
45
+ # installing other requirements
46
+ subprocess.run(["pip", "install", "-r", "requirements.txt"], check=True)
47
+ print("Finished Installing")
48
+
49
+ subprocess.run(["python", "infer-web.py"], check=True)