{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "gpuType": "T4", "include_colab_link": true }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" }, "accelerator": "GPU" }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" }, "source": [ "\"Open" ] }, { "cell_type": "markdown", "source": [ "# SoniTranslate\n", "\n", "| Description | Link |\n", "| ----------- | ---- |\n", "| 🎉 Repository | [![GitHub Repository](https://img.shields.io/badge/GitHub-Repository-black?style=flat-square&logo=github)](https://github.com/R3gm/SoniTranslate/) |\n", "| 🚀 Online Demo in HF | [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co./spaces/r3gm/SoniTranslate_translate_audio_of_a_video_content) |\n", "\n", "\n" ], "metadata": { "id": "8lw0EgLex-YZ" } }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "LUgwm0rfx0_J", "cellView": "form" }, "outputs": [], "source": [ "# @title Install requirements for SoniTranslate\n", "!git clone https://github.com/r3gm/SoniTranslate.git\n", "%cd SoniTranslate\n", "\n", "!apt install git-lfs\n", "!git lfs install\n", "\n", "!sed -i 's|git+https://github.com/R3gm/whisperX.git@cuda_11_8|git+https://github.com/R3gm/whisperX.git@cuda_12_x|' requirements_base.txt\n", "!pip install -q -r requirements_base.txt\n", "!pip install -q -r requirements_extra.txt\n", "!pip install -q ort-nightly-gpu --index-url=https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ort-cuda-12-nightly/pypi/simple/\n", "\n", "Install_PIPER_TTS = True # @param {type:\"boolean\"}\n", "\n", "if Install_PIPER_TTS:\n", " !pip install -q piper-tts==1.2.0\n", "\n", "Install_Coqui_XTTS = True # @param {type:\"boolean\"}\n", "\n", "if Install_Coqui_XTTS:\n", " !pip install -q -r requirements_xtts.txt\n", " !pip install -q TTS==0.21.1 --no-deps" ] }, { "cell_type": "markdown", "source": [ "One important step is to accept the license agreement for using Pyannote. You need to have an account on Hugging Face and `accept the license to use the models`: https://huggingface.co./pyannote/speaker-diarization and https://huggingface.co./pyannote/segmentation\n", "\n", "\n", "\n", "\n", "Get your KEY TOKEN here: https://hf.co/settings/tokens" ], "metadata": { "id": "LTaTstXPXNg2" } }, { "cell_type": "code", "source": [ "#@markdown # `RUN THE WEB APP`\n", "YOUR_HF_TOKEN = \"\" #@param {type:'string'}\n", "%env YOUR_HF_TOKEN={YOUR_HF_TOKEN}\n", "theme = \"Taithrah/Minimal\" # @param [\"Taithrah/Minimal\", \"aliabid94/new-theme\", \"gstaff/xkcd\", \"ParityError/LimeFace\", \"abidlabs/pakistan\", \"rottenlittlecreature/Moon_Goblin\", \"ysharma/llamas\", \"gradio/dracula_revamped\"]\n", "interface_language = \"english\" # @param ['arabic', 'azerbaijani', 'chinese_zh_cn', 'english', 'french', 'german', 'hindi', 'indonesian', 'italian', 'japanese', 'korean', 'marathi', 'polish', 'portuguese', 'russian', 'spanish', 'swedish', 'turkish', 'ukrainian', 'vietnamese']\n", "verbosity_level = \"info\" # @param [\"debug\", \"info\", \"warning\", \"error\", \"critical\"]\n", "\n", "\n", "%cd /content/SoniTranslate\n", "!python app_rvc.py --theme {theme} --verbosity_level {verbosity_level} --language {interface_language} --public_url" ], "metadata": { "id": "XkhXfaFw4R4J", "cellView": "form" }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": [ "Open the `public URL` when it appears" ], "metadata": { "id": "KJW3KrhZJh0u" } } ] }