From ea06bc1a4e4e44d207201b877ebf45b8867e4d1a Mon Sep 17 00:00:00 2001 From: Mangio621 Date: Tue, 9 May 2023 07:08:48 +1000 Subject: [PATCH] Added ipynb avoid automatic shutdown script for paperspace users --- avoid-shutdown.ipynb | 93 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 avoid-shutdown.ipynb diff --git a/avoid-shutdown.ipynb b/avoid-shutdown.ipynb new file mode 100644 index 0000000..6a7a402 --- /dev/null +++ b/avoid-shutdown.ipynb @@ -0,0 +1,93 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Avoid automatic shutdown of the instance" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import time\n", + "time.sleep(1000 * 60 * 60 * 24)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Upload your model to HuggingFace\n", + "\n", + "Since using Git LFS will fill up the storage, we programmatically upload the model to HuggingFace." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from huggingface_hub import login\n", + "login()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from huggingface_hub import HfApi, CommitOperationAdd, CommitOperationDelete\n", + "from pathlib import Path\n", + "api = HfApi()\n", + "operations = [\n", + " CommitOperationAdd(path_in_repo=x, path_or_fileobj=x) for x in Path(\"logs/44k\").rglob(\"*.pth\")\n", + "]\n", + "api = HfApi()\n", + "api.create_commit(\n", + " repo_id=\"username/model_name\",\n", + " operations=operations,\n", + " commit_message=\"feat: add models\",\n", + " create_pr=1,\n", + ")" + ] + } + ], + "metadata": { + "accelerator": "GPU", + "colab": { + "provenance": [ + { + "file_id": "https://github.com/34j/so-vits-svc-fork/blob/feat%2Fmain-feat/so-vits-svc-fork-4.0.ipynb", + "timestamp": 1678970434570 + } + ] + }, + "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" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}