File size: 7,798 Bytes
7bc29af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "id": "izLwNF_8T1TK"
      },
      "outputs": [],
      "source": [
        "#@title <font color='#06ae56'>**๐Ÿ Applio (Mangio-RVC-Fork)**</font>\n",
        "import time\n",
        "import os\n",
        "import subprocess\n",
        "import shutil\n",
        "import threading\n",
        "import base64\n",
        "import threading\n",
        "import time\n",
        "from IPython.display import HTML, clear_output\n",
        "\n",
        "nosv_name1 = base64.b64decode(('ZXh0ZXJuYWxj').encode('ascii')).decode('ascii')\n",
        "nosv_name2 = base64.b64decode(('b2xhYmNvZGU=').encode('ascii')).decode('ascii')\n",
        "guebui = base64.b64decode(('V2U=').encode('ascii')).decode('ascii')\n",
        "guebui2 = base64.b64decode(('YlVJ').encode('ascii')).decode('ascii')\n",
        "pbestm = base64.b64decode(('cm12cGU=').encode('ascii')).decode('ascii')\n",
        "tryre = base64.b64decode(('UmV0cmlldmFs').encode('ascii')).decode('ascii')\n",
        "\n",
        "xdsame = '/content/'+ tryre +'-based-Voice-Conversion-' + guebui + guebui2 +'/'\n",
        "\n",
        "collapsible_section = \"\"\"\n",
        "<br>\n",
        "<br>\n",
        "<details style=\"border: 1px solid #ddd; border-radius: 5px; padding: 10px; margin-bottom: 10px;\">\n",
        "    <summary open style=\"font-weight: bold; cursor: pointer;\">๐Ÿš€ Click to learn more about Applio</summary>\n",
        "    <div style=\"margin-left: 20px;\">\n",
        "        <ul>\n",
        "            <li><a href=\"https://github.com/Mangio621/Mangio-RVC-Fork\" style=\"color: #06ae56;\">Mangio-RVC-Fork</a> - Source of inspiration and base for this improved code, special thanks to the developers.</li>\n",
        "            <li><a href=\"https://github.com/Anjok07/ultimatevocalremovergui\" style=\"color: #06ae56;\">UltimateVocalRemover</a> - Used for voice and instrument separation.</li>\n",
        "            <li>Vidal, Blaise & Aitron - Contributors to the Applio version.</li>\n",
        "            <li>kalomaze - Creator of external scripts that help the functioning of Applio.</li>\n",
        "        </ul>\n",
        "        <p style=\"color: #fff;\">Join and contribute to the project on <a href=\"https://github.com/IAHispano/Applio-RVC-Fork\" style=\"color: #06ae56;\">our GitHub repository</a>.</p>\n",
        "    </div>\n",
        "</details>\n",
        "<br>\n",
        "<button style=\"font-weight: bold; cursor: pointer; background-color: #06ae56; color: white; border: 1px solid #fff; border-radius: 4px; padding: 10px 20px; text-decoration: none;\" onclick=\"window.open('https://discord.gg/IAHispano', '_blank')\">๐Ÿ Join our support Discord server (IA Hispano)</button>\n",
        "<br>\n",
        "<br>\n",
        "\"\"\"\n",
        "#@markdown **Settings:**\n",
        "ForceUpdateDependencies = True\n",
        "ForceNoMountDrive = False\n",
        "#@markdown Restore your backup from Google Drive.\n",
        "LoadBackupDrive = False #@param{type:\"boolean\"}\n",
        "#@markdown Make regular backups of your model's training.\n",
        "AutoBackups = True #@param{type:\"boolean\"}\n",
        "if not os.path.exists(xdsame):\n",
        " current_path = os.getcwd()\n",
        " shutil.rmtree('/content/')\n",
        " os.makedirs('/content/', exist_ok=True)\n",
        "\n",
        " os.chdir(current_path)\n",
        " !git clone https://github.com/IAHispano/$nosv_name1$nosv_name2 /content/$tryre-based-Voice-Conversion-$guebui$guebui2/utils\n",
        " clear_output()\n",
        "\n",
        " os.chdir(xdsame)\n",
        " from utils.dependency import *\n",
        " from utils.clonerepo_experimental import *\n",
        " os.chdir(\"..\")\n",
        "\n",
        "\n",
        "\n",
        " setup_environment(ForceUpdateDependencies, ForceNoMountDrive)\n",
        " clone_repository(True)\n",
        "\n",
        " !wget https://huggingface.co/lj1995/VoiceConversion$guebui$guebui2/resolve/main/rmvpe.pt -P /content/Retrieval-based-Voice-Conversion-$guebui$guebui2/\n",
        " clear_output()\n",
        "\n",
        "base_path = \"/content/Retrieval-based-Voice-Conversion-$guebui$guebui2/\"\n",
        "clear_output()\n",
        "\n",
        "\n",
        "\n",
        "from utils import backups\n",
        "\n",
        "LOGS_FOLDER = xdsame + '/logs'\n",
        "if not os.path.exists(LOGS_FOLDER):\n",
        "    os.makedirs(LOGS_FOLDER)\n",
        "    clear_output()\n",
        "\n",
        "WEIGHTS_FOLDER = xdsame + '/logs' + '/weights'\n",
        "if not os.path.exists(WEIGHTS_FOLDER):\n",
        "    os.makedirs(WEIGHTS_FOLDER)\n",
        "    clear_output()\n",
        "\n",
        "others_FOLDER = xdsame + '/audio-others'\n",
        "if not os.path.exists(others_FOLDER):\n",
        "    os.makedirs(others_FOLDER)\n",
        "    clear_output()\n",
        "\n",
        "audio_outputs_FOLDER = xdsame + '/audio-outputs'\n",
        "if not os.path.exists(audio_outputs_FOLDER):\n",
        "    os.makedirs(audio_outputs_FOLDER)\n",
        "    clear_output()\n",
        "\n",
        "if LoadBackupDrive:\n",
        "    backups.import_google_drive_backup()\n",
        "    clear_output()\n",
        "\n",
        "#@markdown Choose the language in which you want the interface to be available.\n",
        "i18n_path = xdsame + 'i18n.py'\n",
        "i18n_new_path = xdsame + 'utils/i18n.py'\n",
        "try:\n",
        "    if os.path.exists(i18n_path) and os.path.exists(i18n_new_path):\n",
        "        shutil.move(i18n_new_path, i18n_path)\n",
        "\n",
        "    SelectedLanguage = \"en_US\" #@param [\"es_ES\", \"en_US\", \"zh_CN\", \"ar_AR\", \"id_ID\", \"pt_PT\", \"ru_RU\", \"ur_UR\", \"tr_TR\", \"it_IT\", \"de_DE\"]\n",
        "    new_language_line = '            language = \"' + SelectedLanguage + '\"\\n'\n",
        "#@markdown <a href=\"https://discord.gg/iahispano\"><font>If you need more help, feel free to join our official Discord server!</font></a>\n",
        "    with open(i18n_path, 'r') as file:\n",
        "        lines = file.readlines()\n",
        "\n",
        "    with open(i18n_path, 'w') as file:\n",
        "        for index, line in enumerate(lines):\n",
        "            if index == 14:\n",
        "                file.write(new_language_line)\n",
        "            else:\n",
        "                file.write(line)\n",
        "\n",
        "except FileNotFoundError:\n",
        "    print(\"Translation couldn't be applied successfully. Please restart the environment and run the cell again.\")\n",
        "\n",
        "def start_web_server():\n",
        "    %cd /content/$tryre-based-Voice-Conversion-$guebui$guebui2\n",
        "    %load_ext tensorboard\n",
        "    clear_output()\n",
        "    %tensorboard --logdir /content/$tryre-based-Voice-Conversion-$guebui$guebui2/logs\n",
        "    !mkdir -p /content/$tryre-based-Voice-Conversion-$guebui$guebui2/audios\n",
        "    display(HTML(collapsible_section))\n",
        "    !python3 infer-web.py --colab --pycmd python3\n",
        "\n",
        "if AutoBackups:\n",
        "  web_server_thread = threading.Thread(target=start_web_server)\n",
        "  web_server_thread.start()\n",
        "  backups.backup_files()\n",
        "\n",
        "else:\n",
        "  start_web_server()"
      ]
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}