Skip to content

Commit a26ed91

Browse files
authored
Updating colab to use poetry (#107)
* Updating colab to use poetry * Adding helpful comment to colab cell
1 parent 48bd134 commit a26ed91

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

colab_demo.ipynb

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,27 @@
4545
},
4646
"outputs": [],
4747
"source": [
48-
"!pip install -r requirements.txt\n",
49-
"!pip install --upgrade torch torchaudio"
48+
"!sudo apt install pipx\n",
49+
"!pipx install poetry\n",
50+
"!pipx run poetry install && pipx run poetry run pip install torch==2.2.1 torchaudio==2.2.1\n",
51+
"!pipx run poetry env list | sed 's/ (Activated)//' > poetry_env.txt\n",
52+
"# NOTE: pip's dependency resolver will error & complain, ignore it!\n",
53+
"# its due to a temporary dependency issue, `tts.synthesise` will still work as intended!"
54+
]
55+
},
56+
{
57+
"cell_type": "code",
58+
"execution_count": null,
59+
"metadata": {
60+
"vscode": {
61+
"languageId": "plaintext"
62+
}
63+
},
64+
"outputs": [],
65+
"source": [
66+
"import sys, pathlib\n",
67+
"venv = pathlib.Path(\"poetry_env.txt\").read_text().strip(\"\\n\")\n",
68+
"sys.path.append(f\"/root/.cache/pypoetry/virtualenvs/{venv}/lib/python3.10/site-packages\")"
5069
]
5170
},
5271
{
@@ -91,19 +110,19 @@
91110
}
92111
],
93112
"metadata": {
113+
"accelerator": "GPU",
94114
"colab": {
95-
"provenance": [],
96-
"gpuType": "T4"
115+
"gpuType": "T4",
116+
"provenance": []
97117
},
98118
"kernelspec": {
99-
"name": "python3",
100-
"display_name": "Python 3"
119+
"display_name": "Python 3",
120+
"name": "python3"
101121
},
102122
"language_info": {
103123
"name": "python"
104-
},
105-
"accelerator": "GPU"
124+
}
106125
},
107126
"nbformat": 4,
108127
"nbformat_minor": 2
109-
}
128+
}

0 commit comments

Comments
 (0)