# %% [code] {"jupyter":{"outputs_hidden":false}} # Примечание (Не тыкать\или удалить) Называние Датасета и модели должно быть одинаковым, во избежание проблем! # Замените "МОДЕЛЬ-ВАША" на название вашего датасета/название модели # Скрипт обновил: https://t.me/aisingers / vk.com/aisingers (RVC V2 Version Script 3.0 alpha ) # Автор ( @by @varaslaw \ @player1444 \ @lunnaholy) # FAQ Скрипта по тренировке: https://clck.ru/34rnq5 # %% [code] {"scrolled":true,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2023-07-15T05:37:36.545175Z","iopub.execute_input":"2023-07-15T05:37:36.545586Z","iopub.status.idle":"2023-07-15T06:55:40.989542Z","shell.execute_reply.started":"2023-07-15T05:37:36.545541Z","shell.execute_reply":"2023-07-15T06:55:40.988171Z"}} # Установка и подготовка рабочей среды !mamba create -n py39 -y > /dev/null !source /opt/conda/bin/activate py39 && mamba install python=3.9 jupyter mamba -y > /dev/null !sudo rm -f /opt/conda/bin/python3 /opt/conda/bin/python3.7 /opt/conda/bin/python > /dev/null !sudo ln -sf /opt/conda/envs/py39/bin/python3 /opt/conda/bin/python3 > /dev/null !sudo ln -sf /opt/conda/envs/py39/bin/python3 /opt/conda/bin/python3.7 > /dev/null !sudo ln -sf /opt/conda/envs/py39/bin/python3 /opt/conda/bin/python > /dev/null !python --version !git clone https://github.com/Mangio621/Mangio-RVC-Fork/ > /dev/null %cd Mangio-RVC-Fork !python -m pip install -r requirements.txt !python -m pip install joblib==1.3.1 !python -m pip install numba==0.57.1 !python -m pip install numpy==1.25.1 !python -m pip install scipy==1.11.1 !python -m pip install librosa==0.10.0 !python -m pip install llvmlite==0.40.1 !python -m pip install fairseq==0.12.2 !python -m pip install faiss-cpu==1.7.4 !python -m pip install Cython==3.0.0 !python -m pip install pydub==0.25.1 !python -m pip install soundfile==0.12.1 !python -m pip install ffmpeg-python==0.2.0 !python -m pip install tensorboardX==2.6.1 !python -m pip install Jinja2==3.1.2 !python -m pip install json5==0.9.14 !python -m pip install Markdown==3.4.3 !python -m pip install matplotlib==3.7.2 !python -m pip install matplotlib-inline==0.1.6 !python -m pip install praat-parselmouth==0.4.3 !python -m pip install Pillow==10.0.0 !python -m pip install resampy==0.4.2 !python -m pip install scikit-learn==1.3.0 !python -m pip install tensorboard==2.13.0 !python -m pip install tensorboard-data-server==0.7.1 !python -m pip install tensorboard-plugin-wit==1.8.1 !python -m pip install torchgen==0.0.1 !python -m pip install torch==2.0.1 !python -m pip install tqdm==4.65.0 !python -m pip install tornado==6.3.2 !python -m pip install Werkzeug==2.3.6 !python -m pip install uc-micro-py==1.0.2 !python -m pip install sympy==1.12 !python -m pip install tabulate==0.9.0 !python -m pip install PyYAML==6.0.1 !python -m pip install pyasn1==0.4.8 !python -m pip install pyasn1-modules==0.3.0 !python -m pip install fsspec== 2023.6.0 !python -m pip install absl-py==1.4.0 !python -m pip install audioread==3.0.0 !python -m pip install uvicorn==0.23.1 !python -m pip install colorama==0.4.6 !python -m pip install pyworld==0.3.2 !python -m pip install httpx==0.24.1 !python -m pip install onnxruntime-gpu==1.15.1 !python -m pip install torchcrepe==0.0.20 !python -m pip install fastapi==0.100.0 !python -m pip install pyproject-toml==0.0.10 !python -m pip install fsspec==2023.6.0 !python -m pip install gradio --upgrade # %% [code] {"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2023-07-15T05:36:48.837473Z","iopub.execute_input":"2023-07-15T05:36:48.837885Z","iopub.status.idle":"2023-07-15T05:36:49.798613Z","shell.execute_reply.started":"2023-07-15T05:36:48.837850Z","shell.execute_reply":"2023-07-15T05:36:49.797485Z"}} # Создание Dataset (команда рабочая) !mkdir /kaggle/working/dataset && cp /kaggle/input/МОДЕЛЬ ВАША/* /kaggle/working/dataset # %% [code] {"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2023-07-15T05:37:09.407717Z","iopub.execute_input":"2023-07-15T05:37:09.408124Z","iopub.status.idle":"2023-07-15T05:37:21.297057Z","shell.execute_reply.started":"2023-07-15T05:37:09.408089Z","shell.execute_reply":"2023-07-15T05:37:21.295668Z"}} # Копирование предобученных моделей Mangio-RVC-Fork !cp /kaggle/input/rvc-necessary/hubert_base.pt /kaggle/working/Mangio-RVC-Fork/hubert_base.pt !cp /kaggle/input/rvc-necessary/G40k.pth /kaggle/working/Mangio-RVC-Fork/pretrained_v2/G40k.pth !cp /kaggle/input/rvc-necessary/D40k.pth /kaggle/working/Mangio-RVC-Fork/pretrained_v2/D40k.pth !cp /kaggle/input/rvc-necessary/f0G40k.pth /kaggle/working/Mangio-RVC-Fork/pretrained_v2/f0G40k.pth !cp /kaggle/input/rvc-necessary/f0D40k.pth /kaggle/working/Mangio-RVC-Fork/pretrained_v2/f0D40k.pth # %% [code] {"scrolled":true,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2023-07-15T05:37:36.545175Z","iopub.execute_input":"2023-07-15T05:37:36.545586Z","iopub.status.idle":"2023-07-15T06:55:40.989542Z","shell.execute_reply.started":"2023-07-15T05:37:36.545541Z","shell.execute_reply":"2023-07-15T06:55:40.988171Z"}} # Запуск скрипта и среды gradio !python /kaggle/working/Mangio-RVC-Fork/infer-web.py --pycmd python --paperspace # %% [code] {"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2023-07-15T06:55:44.734761Z","iopub.execute_input":"2023-07-15T06:55:44.735181Z","iopub.status.idle":"2023-07-15T06:56:20.131621Z","shell.execute_reply.started":"2023-07-15T06:55:44.735146Z","shell.execute_reply":"2023-07-15T06:56:20.130608Z"}} # Создание zip-архива на file.io import os import shutil import time import requests import glob output_dir = '/kaggle/working/out' weights_path = '/kaggle/working/Mangio-RVC-Fork/weights/МОДЕЛЬ-ВАША.pth' index_files = glob.glob('/kaggle/working/Mangio-RVC-Fork/logs/*/added*.index') if not os.path.exists(output_dir): os.makedirs(output_dir) shutil.copy(weights_path, os.path.join(output_dir, 'МОДЕЛЬ-ВАША.pth')) for index_file in index_files: index_filename = os.path.basename(index_file) if index_filename.startswith('added'): shutil.copy(index_file, os.path.join(output_dir, index_filename)) break else: print('Файл .index не найден.') zip_filename = '/kaggle/working/out.zip' shutil.make_archive(output_dir, 'zip', output_dir) # Ожидаем завершения архивации while not os.path.exists(zip_filename): time.sleep(1) # Загружаем архив на file.io with open(zip_filename, 'rb') as file: response = requests.post('https://file.io/?expires=1w', files={'file': file}) # Получаем ссылку на скачивание архива download_link = response.json()['link'] print('Ссылка на скачивание архива:', download_link)