From 2fb4194f72607357aa440bfd23cda5482fe5b53e Mon Sep 17 00:00:00 2001 From: lucapericlp Date: Mon, 18 Mar 2024 13:57:54 +0000 Subject: [PATCH 1/2] Updating colab to use poetry --- colab_demo.ipynb | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/colab_demo.ipynb b/colab_demo.ipynb index 3b89765..4ff9468 100644 --- a/colab_demo.ipynb +++ b/colab_demo.ipynb @@ -45,8 +45,25 @@ }, "outputs": [], "source": [ - "!pip install -r requirements.txt\n", - "!pip install --upgrade torch torchaudio" + "!sudo apt install pipx\n", + "!pipx install poetry\n", + "!pipx run poetry install && pipx run poetry run pip install torch==2.2.1 torchaudio==2.2.1\n", + "!pipx run poetry env list | sed 's/ (Activated)//' > poetry_env.txt" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "plaintext" + } + }, + "outputs": [], + "source": [ + "import sys, pathlib\n", + "venv = pathlib.Path(\"poetry_env.txt\").read_text().strip(\"\\n\")\n", + "sys.path.append(f\"/root/.cache/pypoetry/virtualenvs/{venv}/lib/python3.10/site-packages\")" ] }, { @@ -91,19 +108,19 @@ } ], "metadata": { + "accelerator": "GPU", "colab": { - "provenance": [], - "gpuType": "T4" + "gpuType": "T4", + "provenance": [] }, "kernelspec": { - "name": "python3", - "display_name": "Python 3" + "display_name": "Python 3", + "name": "python3" }, "language_info": { "name": "python" - }, - "accelerator": "GPU" + } }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 34bc8165a5016bd6acb32f140bb4a7e7890aa5f6 Mon Sep 17 00:00:00 2001 From: lucapericlp Date: Sun, 24 Mar 2024 13:05:52 +0000 Subject: [PATCH 2/2] Adding helpful comment to colab cell --- colab_demo.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/colab_demo.ipynb b/colab_demo.ipynb index 4ff9468..f07a1a7 100644 --- a/colab_demo.ipynb +++ b/colab_demo.ipynb @@ -48,7 +48,9 @@ "!sudo apt install pipx\n", "!pipx install poetry\n", "!pipx run poetry install && pipx run poetry run pip install torch==2.2.1 torchaudio==2.2.1\n", - "!pipx run poetry env list | sed 's/ (Activated)//' > poetry_env.txt" + "!pipx run poetry env list | sed 's/ (Activated)//' > poetry_env.txt\n", + "# NOTE: pip's dependency resolver will error & complain, ignore it!\n", + "# its due to a temporary dependency issue, `tts.synthesise` will still work as intended!" ] }, {