Skip to content

Commit

Permalink
Updating colab to use poetry (metavoiceio#107)
Browse files Browse the repository at this point in the history
* Updating colab to use poetry

* Adding helpful comment to colab cell
  • Loading branch information
lucapericlp authored Mar 25, 2024
1 parent 48bd134 commit a26ed91
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions colab_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,27 @@
},
"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\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!"
]
},
{
"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\")"
]
},
{
Expand Down Expand Up @@ -91,19 +110,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
}
}

0 comments on commit a26ed91

Please sign in to comment.