{
	"cells": [
		{
			"cell_type": "markdown",
			"metadata": {
				"id": "ni41hmE03DL6"
			},
			"source": [
				"## Initialization"
			]
		},
		{
			"cell_type": "code",
			"metadata": {
				"id": "FtsMKKfH18iM"
			},
			"source": [
				"!sudo apt update\n",
				"!sudo apt-get install python3.9-venv -y\n",
				"%cd /notebooks/\n",
				"!git clone https://git.ecker.tech/mrq/ai-voice-cloning/\n",
				"!ln -s ./ai-voice-cloning/models/ ./\n",
				"%cd ai-voice-cloning\n",
				"!./setup-cuda.sh\n",
				"#!./update.sh"
			]
		},
		{
			"cell_type": "markdown",
			"metadata": {
				"id": "IzrGt5IcHlAD"
			},
			"source": [
				"# Update Repos"
			]
		},
		{
			"cell_type": "code",
			"metadata": {
				"id": "3DktoOXSHmtw"
			},
			"source": [
				"# for my debugging purposes\n",
				"%cd /notebooks/ai-voice-cloning/\n",
				"!sudo apt update\n",
				"!sudo apt-get install python3.9-venv -y\n",
				"!mkdir -p ~/.cache\n",
				"!ln -s /notebooks/ai-voice-cloning/models/voicefixer ~/.cache/.\n",
				"!./update-force.sh\n",
				"#!git pull\n",
				"#!git submodule update --remote"
			]
		},
		{
			"cell_type": "markdown",
			"metadata": {
				"id": "o1gkfw3B3JSk"
			},
			"source": [
				"## Running"
			]
		},
		{
			"cell_type": "code",
			"metadata": {
				"id": "c_EQZLTA19c7"
			},
			"source": [
				"%cd /notebooks/ai-voice-cloning\n",
				"\n",
				"!export TORTOISE_MODELS_DIR=/notebooks/ai-voice-cloning/models/tortoise/\n",
				"!export TRANSFORMERS_CACHE=/notebooks/ai-voice-cloning/models/transformers/\n",
				"\n",
				"!./start.sh --share"
			]
		},
		{
			"cell_type": "markdown",
			"metadata": {
				"id": "2AnVQxEJx47p"
			},
			"source": [
				"## Exporting"
			]
		},
		{
			"cell_type": "code",
			"metadata": {
				"id": "YOACiDCXx72G"
			},
			"source": [
				"%cd /notebooks/ai-voice-cloning\n",
				"!apt install -y p7zip-full\n",
				"from datetime import datetime\n",
				"timestamp = datetime.now().strftime('%m-%d-%Y_%H:%M:%S')\n",
				"!mkdir -p \"../{timestamp}/results\"\n",
				"!mv ./results/* \"../{timestamp}/results/.\"\n",
				"!mv ./training/* \"../{timestamp}/training/.\"\n",
				"!7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on \"../{timestamp}.7z\" \"../{timestamp}/\"\n",
				"!ls ~/\n",
				"!echo \"Finished zipping, archive is available at {timestamp}.7z\""
			]
		}
	],
	"metadata": {
		"accelerator": "GPU",
		"colab": {
			"private_outputs": true,
			"provenance": []
		},
		"gpuClass": "standard",
		"kernelspec": {
			"display_name": "Python 3 (ipykernel)",
			"language": "python",
			"name": "python3"
		},
		"language_info": {
			"codemirror_mode": {
				"name": "ipython",
				"version": 3
			},
			"file_extension": ".py",
			"mimetype": "text/x-python",
			"name": "python",
			"nbconvert_exporter": "python",
			"pygments_lexer": "ipython3",
			"version": "3.9.13"
		}
	},
	"nbformat": 4,
	"nbformat_minor": 4
}