{ "cells": [ { "cell_type": "markdown", "id": "21111b1f-7cce-4e8b-8337-8f0cdab5804e", "metadata": {}, "source": [ "# AutoTrain" ] }, { "cell_type": "markdown", "id": "dd09a9fd-4b90-48f3-b61c-d2349eb7f43e", "metadata": {}, "source": [ "## Imports" ] }, { "cell_type": "code", "execution_count": 1, "id": "52543575-f92e-4038-ad13-30967f47eb7a", "metadata": { "jupyter": { "is_executing": true } }, "outputs": [], "source": [ "import os\n", "import subprocess\n", "\n", "import yaml" ] }, { "cell_type": "markdown", "id": "74987944-abfb-44f8-9331-ffbb2f7698bb", "metadata": {}, "source": [ "## Config" ] }, { "cell_type": "code", "execution_count": 2, "id": "6992324b-173c-4335-b557-cf78fbb2dd93", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "928f44f483504b438e0fdbd4df3d7dd5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='
\n", "WAIT TO RUN THIS UNTIL YOUR SPACES ARE FINISHED TRAINING!\n", "" ] }, { "cell_type": "code", "execution_count": null, "id": "f86ed8ad-4e38-454a-a2c1-b1f075399c37", "metadata": {}, "outputs": [], "source": [ "for space in autotrain_spaces:\n", " confirm = input(f\"Are you sure you want to delete the space '{space}'? (y/n): \")\n", " if confirm.lower() == 'y':\n", " api.delete_repo(space, repo_type='space')\n", " print(f\"Deleted {space}\")\n", " else:\n", " print(f\"Skipped {space}\")\n" ] }, { "cell_type": "markdown", "id": "2182f8fe-8504-4cb9-a0a6-4b143541158d", "metadata": {}, "source": [ "\n", "ONLY RUN THIS IF YOU NEED TO RESTART FROM SCRATCH\n", "THIS WILL DELETE YOUR MODELS\n", "" ] }, { "cell_type": "code", "execution_count": null, "id": "12939405-a731-4a7c-ab4a-e1a4f1850bb6", "metadata": {}, "outputs": [], "source": [ "# for model in autotrain_models:\n", "# confirm = input(f\"Are you sure you want to delete the model '{model}'? (y/n): \")\n", "# if confirm.lower() == 'y':\n", "# api.delete_repo(model, repo_type='model')\n", "# print(f\"Deleted {model}\")\n", "# else:\n", "# print(f\"Skipped {model}\")\n" ] }, { "cell_type": "code", "execution_count": null, "id": "c2a2c864-2082-4be9-8e28-92fd01833e38", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "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.11.11" } }, "nbformat": 4, "nbformat_minor": 5 }