Commit
·
f015573
1
Parent(s):
2d91907
Upload 5 files
Browse files
notebooks/google_collab.ipynb
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
+
"id": "Omt6xz6ljwIR",
|
7 |
+
"metadata": {
|
8 |
+
"colab": {
|
9 |
+
"base_uri": "https://localhost:8080/"
|
10 |
+
},
|
11 |
+
"id": "Omt6xz6ljwIR",
|
12 |
+
"outputId": "89fb352e-84a8-4d3e-b0dc-28ee9d9a3e6e"
|
13 |
+
},
|
14 |
+
"outputs": [],
|
15 |
+
"source": [
|
16 |
+
"!git clone https://github.com/rsxdalv/tts-generation-webui\n"
|
17 |
+
]
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"cell_type": "code",
|
21 |
+
"execution_count": null,
|
22 |
+
"id": "a66bf3c4",
|
23 |
+
"metadata": {},
|
24 |
+
"outputs": [],
|
25 |
+
"source": [
|
26 |
+
"import os\n",
|
27 |
+
"os.chdir(\"./tts-generation-webui\")"
|
28 |
+
]
|
29 |
+
},
|
30 |
+
{
|
31 |
+
"cell_type": "code",
|
32 |
+
"execution_count": null,
|
33 |
+
"id": "HULYvnXTjzZX",
|
34 |
+
"metadata": {
|
35 |
+
"colab": {
|
36 |
+
"base_uri": "https://localhost:8080/"
|
37 |
+
},
|
38 |
+
"id": "HULYvnXTjzZX",
|
39 |
+
"outputId": "56cd665f-a6b5-4565-ddbc-7c59053d4e4b"
|
40 |
+
},
|
41 |
+
"outputs": [],
|
42 |
+
"source": [
|
43 |
+
"# Run install/updates\n",
|
44 |
+
"!git pull\n",
|
45 |
+
"!pip install -r requirements.txt\n",
|
46 |
+
"!python update.py"
|
47 |
+
]
|
48 |
+
},
|
49 |
+
{
|
50 |
+
"cell_type": "code",
|
51 |
+
"execution_count": null,
|
52 |
+
"id": "203e8384",
|
53 |
+
"metadata": {},
|
54 |
+
"outputs": [],
|
55 |
+
"source": [
|
56 |
+
"# Fix for deepspeed for tortoise\n",
|
57 |
+
"# pip uninstall deepspeed\n",
|
58 |
+
"# pip install deepspeed==0.8.3"
|
59 |
+
]
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"cell_type": "code",
|
63 |
+
"execution_count": null,
|
64 |
+
"id": "7726b943",
|
65 |
+
"metadata": {},
|
66 |
+
"outputs": [],
|
67 |
+
"source": [
|
68 |
+
"# Fix torchvision for MusicGen \n",
|
69 |
+
"# !pip install torchvision==0.15.0+cu117 --extra-index-url https://download.pytorch.org/whl/cu117"
|
70 |
+
]
|
71 |
+
},
|
72 |
+
{
|
73 |
+
"cell_type": "code",
|
74 |
+
"execution_count": null,
|
75 |
+
"id": "r0FihjXLklZG",
|
76 |
+
"metadata": {
|
77 |
+
"colab": {
|
78 |
+
"base_uri": "https://localhost:8080/"
|
79 |
+
},
|
80 |
+
"id": "r0FihjXLklZG",
|
81 |
+
"outputId": "77b5030b-2d12-4c20-ab0d-970b53b9ac08"
|
82 |
+
},
|
83 |
+
"outputs": [],
|
84 |
+
"source": [
|
85 |
+
"!python server.py --share"
|
86 |
+
]
|
87 |
+
}
|
88 |
+
],
|
89 |
+
"metadata": {
|
90 |
+
"colab": {
|
91 |
+
"provenance": []
|
92 |
+
},
|
93 |
+
"kernelspec": {
|
94 |
+
"display_name": "Python 3",
|
95 |
+
"language": "python",
|
96 |
+
"name": "python3"
|
97 |
+
},
|
98 |
+
"language_info": {
|
99 |
+
"codemirror_mode": {
|
100 |
+
"name": "ipython",
|
101 |
+
"version": 3
|
102 |
+
},
|
103 |
+
"file_extension": ".py",
|
104 |
+
"mimetype": "text/x-python",
|
105 |
+
"name": "python",
|
106 |
+
"nbconvert_exporter": "python",
|
107 |
+
"pygments_lexer": "ipython3",
|
108 |
+
"version": "3.10.11"
|
109 |
+
}
|
110 |
+
},
|
111 |
+
"nbformat": 4,
|
112 |
+
"nbformat_minor": 5
|
113 |
+
}
|
notebooks/samples/konichihaaaaaaaaaa.npz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:950fe16b48f68fa33f77be7c65540111bbdf29e255379ac6d0d8762e5fc83776
|
3 |
+
size 14980
|
notebooks/samples/konichihaaaaaaaaaa.wav
ADDED
Binary file (170 kB). View file
|
|
notebooks/vocos.ipynb
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
+
"id": "0ba083d2",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [],
|
9 |
+
"source": [
|
10 |
+
"import torch\n",
|
11 |
+
"from vocos import Vocos\n",
|
12 |
+
"import torchaudio\n",
|
13 |
+
"\n",
|
14 |
+
"vocos = Vocos.from_pretrained(\"charactr/vocos-encodec-24khz\")\n",
|
15 |
+
"\n",
|
16 |
+
"bandwidth_id = torch.tensor([3]) # 12 kbps\n",
|
17 |
+
"\n",
|
18 |
+
"y, sr = torchaudio.load(\"./samples/konichihaaaaaaaaaa.wav\")\n",
|
19 |
+
"if y.size(0) > 1: # mix to mono\n",
|
20 |
+
" y = y.mean(dim=0, keepdim=True)\n",
|
21 |
+
"y = torchaudio.functional.resample(y, orig_freq=sr, new_freq=24000)\n",
|
22 |
+
"\n",
|
23 |
+
"with torch.no_grad():\n",
|
24 |
+
" y_hat = vocos(y, bandwidth_id=bandwidth_id)\n",
|
25 |
+
"\n",
|
26 |
+
"torchaudio.save(\"samples/rap_base_vocos.wav\", y_hat, 24000)\n",
|
27 |
+
"\n",
|
28 |
+
"import IPython.display as ipd\n",
|
29 |
+
"ipd.Audio(\"samples/rap_base_vocos.wav\")"
|
30 |
+
]
|
31 |
+
}
|
32 |
+
],
|
33 |
+
"metadata": {
|
34 |
+
"kernelspec": {
|
35 |
+
"display_name": "Python 3",
|
36 |
+
"language": "python",
|
37 |
+
"name": "python3"
|
38 |
+
},
|
39 |
+
"language_info": {
|
40 |
+
"codemirror_mode": {
|
41 |
+
"name": "ipython",
|
42 |
+
"version": 3
|
43 |
+
},
|
44 |
+
"file_extension": ".py",
|
45 |
+
"mimetype": "text/x-python",
|
46 |
+
"name": "python",
|
47 |
+
"nbconvert_exporter": "python",
|
48 |
+
"pygments_lexer": "ipython3",
|
49 |
+
"version": "3.10.11"
|
50 |
+
}
|
51 |
+
},
|
52 |
+
"nbformat": 4,
|
53 |
+
"nbformat_minor": 5
|
54 |
+
}
|
outputs-rvc/.gitkeep
ADDED
File without changes
|