{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "-iqK1uZxKOPk" }, "source": [] }, { "cell_type": "code", "execution_count": 3, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "BarGLJEUlp88", "outputId": "84b24178-ffbb-4151-de2d-069dd5746ac7" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: datasets in /usr/local/lib/python3.10/dist-packages (2.19.1)\n", "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from datasets) (3.14.0)\n", "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from datasets) (1.25.2)\n", "Requirement already satisfied: pyarrow>=12.0.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (14.0.2)\n", "Requirement already satisfied: pyarrow-hotfix in /usr/local/lib/python3.10/dist-packages (from datasets) (0.6)\n", "Requirement already satisfied: dill<0.3.9,>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (0.3.8)\n", "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from datasets) (2.0.3)\n", "Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (2.31.0)\n", "Requirement already satisfied: tqdm>=4.62.1 in /usr/local/lib/python3.10/dist-packages (from datasets) (4.66.4)\n", "Requirement already satisfied: xxhash in /usr/local/lib/python3.10/dist-packages (from datasets) (3.4.1)\n", "Requirement already satisfied: multiprocess in /usr/local/lib/python3.10/dist-packages (from datasets) (0.70.16)\n", "Requirement already satisfied: fsspec[http]<=2024.3.1,>=2023.1.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (2023.6.0)\n", "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from datasets) (3.9.5)\n", "Requirement already satisfied: huggingface-hub>=0.21.2 in /usr/local/lib/python3.10/dist-packages (from datasets) (0.23.0)\n", "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from datasets) (24.0)\n", "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from datasets) (6.0.1)\n", "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.3.1)\n", "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (23.2.0)\n", "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.4.1)\n", "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (6.0.5)\n", "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.9.4)\n", "Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (4.0.3)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.21.2->datasets) (4.11.0)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (3.3.2)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (3.7)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (2.0.7)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (2024.2.2)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2.8.2)\n", "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2023.4)\n", "Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2024.1)\n", "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas->datasets) (1.16.0)\n" ] } ], "source": [ "pip install datasets" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "MoeKcp3tlQSf", "outputId": "1d6fd480-d37f-4028-de75-9595abc97464" }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/user/Desktop/model/venv/lib/python3.11/site-packages/datasets/load.py:1486: FutureWarning: The repository for marsyas/gtzan contains custom code which must be executed to correctly load the dataset. You can inspect the repository content at https://hf.co/datasets/marsyas/gtzan\n", "You can avoid this message in future by passing the argument `trust_remote_code=True`.\n", "Passing `trust_remote_code=True` will be mandatory to load this dataset from the next major release of `datasets`.\n", " warnings.warn(\n" ] }, { "data": { "text/plain": [ "DatasetDict({\n", " train: Dataset({\n", " features: ['file', 'audio', 'genre'],\n", " num_rows: 999\n", " })\n", "})" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from datasets import load_dataset\n", "\n", "gtzan = load_dataset(\"marsyas/gtzan\", \"all\")\n", "gtzan" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "A3GolExklYZH", "outputId": "bdf2d280-749a-4a62-b398-92aa9174079e" }, "outputs": [ { "data": { "text/plain": [ "DatasetDict({\n", " train: Dataset({\n", " features: ['file', 'audio', 'genre'],\n", " num_rows: 999\n", " })\n", "})" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gtzan" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "id": "r7nBVDEKmKzq" }, "outputs": [], "source": [ "gtzan = gtzan['train'].train_test_split(seed=42, test_size=0.1)\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "AVT3baEn9IAo", "outputId": "8c3fe83a-b0a6-4427-c401-28722a4725fb" }, "outputs": [ { "data": { "text/plain": [ "{'file': '/home/user/.cache/huggingface/datasets/downloads/extracted/8467212e1467f829ca8aa5be797cbd9704e95050d4c3e44235bb44dfacaa486f/genres/pop/pop.00098.wav',\n", " 'audio': {'path': '/home/user/.cache/huggingface/datasets/downloads/extracted/8467212e1467f829ca8aa5be797cbd9704e95050d4c3e44235bb44dfacaa486f/genres/pop/pop.00098.wav',\n", " 'array': array([ 0.10720825, 0.16122437, 0.28585815, ..., -0.22924805,\n", " -0.20629883, -0.11334229]),\n", " 'sampling_rate': 22050},\n", " 'genre': 7}" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gtzan[\"train\"][0]" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "id": "qrB5kdIx9WwX", "outputId": "3c0eaa93-f8db-4b39-d5dd-d312d82cc554" }, "outputs": [ { "data": { "text/plain": [ "'pop'" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id2label_fn = gtzan[\"train\"].features[\"genre\"].int2str\n", "id2label_fn(gtzan[\"train\"][0][\"genre\"])" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "MHzcJshE9b1B", "outputId": "dff1405a-1070-44e5-eb08-ace3416df099" }, "outputs": [ { "data": { "text/plain": [ "DatasetDict({\n", " train: Dataset({\n", " features: ['file', 'audio', 'genre'],\n", " num_rows: 899\n", " })\n", " test: Dataset({\n", " features: ['file', 'audio', 'genre'],\n", " num_rows: 100\n", " })\n", "})" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gtzan" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Q54XUqyW9opO", "outputId": "2a03f78b-b911-42ea-ab87-0f8250cedb16" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: gradio in ./venv/lib/python3.11/site-packages (4.31.4)\n", "Requirement already satisfied: aiofiles<24.0,>=22.0 in ./venv/lib/python3.11/site-packages (from gradio) (23.2.1)\n", "Requirement already satisfied: altair<6.0,>=4.2.0 in ./venv/lib/python3.11/site-packages (from gradio) (5.3.0)\n", "Requirement already satisfied: fastapi in ./venv/lib/python3.11/site-packages (from gradio) (0.111.0)\n", "Requirement already satisfied: ffmpy in ./venv/lib/python3.11/site-packages (from gradio) (0.3.2)\n", "Requirement already satisfied: gradio-client==0.16.4 in ./venv/lib/python3.11/site-packages (from gradio) (0.16.4)\n", "Requirement already satisfied: httpx>=0.24.1 in ./venv/lib/python3.11/site-packages (from gradio) (0.27.0)\n", "Requirement already satisfied: huggingface-hub>=0.19.3 in ./venv/lib/python3.11/site-packages (from gradio) (0.23.0)\n", "Requirement already satisfied: importlib-resources<7.0,>=1.3 in ./venv/lib/python3.11/site-packages (from gradio) (6.4.0)\n", "Requirement already satisfied: jinja2<4.0 in ./venv/lib/python3.11/site-packages (from gradio) (3.1.4)\n", "Requirement already satisfied: markupsafe~=2.0 in ./venv/lib/python3.11/site-packages (from gradio) (2.1.5)\n", "Requirement already satisfied: matplotlib~=3.0 in ./venv/lib/python3.11/site-packages (from gradio) (3.9.0)\n", "Requirement already satisfied: numpy~=1.0 in ./venv/lib/python3.11/site-packages (from gradio) (1.26.4)\n", "Requirement already satisfied: orjson~=3.0 in ./venv/lib/python3.11/site-packages (from gradio) (3.10.3)\n", "Requirement already satisfied: packaging in ./venv/lib/python3.11/site-packages (from gradio) (24.0)\n", "Requirement already satisfied: pandas<3.0,>=1.0 in ./venv/lib/python3.11/site-packages (from gradio) (2.2.2)\n", "Requirement already satisfied: pillow<11.0,>=8.0 in ./venv/lib/python3.11/site-packages (from gradio) (10.3.0)\n", "Requirement already satisfied: pydantic>=2.0 in ./venv/lib/python3.11/site-packages (from gradio) (2.7.1)\n", "Requirement already satisfied: pydub in ./venv/lib/python3.11/site-packages (from gradio) (0.25.1)\n", "Requirement already satisfied: python-multipart>=0.0.9 in ./venv/lib/python3.11/site-packages (from gradio) (0.0.9)\n", "Requirement already satisfied: pyyaml<7.0,>=5.0 in ./venv/lib/python3.11/site-packages (from gradio) (6.0.1)\n", "Requirement already satisfied: ruff>=0.2.2 in ./venv/lib/python3.11/site-packages (from gradio) (0.4.4)\n", "Requirement already satisfied: semantic-version~=2.0 in ./venv/lib/python3.11/site-packages (from gradio) (2.10.0)\n", "Requirement already satisfied: tomlkit==0.12.0 in ./venv/lib/python3.11/site-packages (from gradio) (0.12.0)\n", "Requirement already satisfied: typer<1.0,>=0.12 in ./venv/lib/python3.11/site-packages (from gradio) (0.12.3)\n", "Requirement already satisfied: typing-extensions~=4.0 in ./venv/lib/python3.11/site-packages (from gradio) (4.11.0)\n", "Requirement already satisfied: urllib3~=2.0 in ./venv/lib/python3.11/site-packages (from gradio) (2.2.1)\n", "Requirement already satisfied: uvicorn>=0.14.0 in ./venv/lib/python3.11/site-packages (from gradio) (0.29.0)\n", "Requirement already satisfied: fsspec in ./venv/lib/python3.11/site-packages (from gradio-client==0.16.4->gradio) (2024.3.1)\n", "Requirement already satisfied: websockets<12.0,>=10.0 in ./venv/lib/python3.11/site-packages (from gradio-client==0.16.4->gradio) (11.0.3)\n", "Requirement already satisfied: jsonschema>=3.0 in ./venv/lib/python3.11/site-packages (from altair<6.0,>=4.2.0->gradio) (4.22.0)\n", "Requirement already satisfied: toolz in ./venv/lib/python3.11/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.1)\n", "Requirement already satisfied: anyio in ./venv/lib/python3.11/site-packages (from httpx>=0.24.1->gradio) (4.3.0)\n", "Requirement already satisfied: certifi in ./venv/lib/python3.11/site-packages (from httpx>=0.24.1->gradio) (2024.2.2)\n", "Requirement already satisfied: httpcore==1.* in ./venv/lib/python3.11/site-packages (from httpx>=0.24.1->gradio) (1.0.5)\n", "Requirement already satisfied: idna in ./venv/lib/python3.11/site-packages (from httpx>=0.24.1->gradio) (3.7)\n", "Requirement already satisfied: sniffio in ./venv/lib/python3.11/site-packages (from httpx>=0.24.1->gradio) (1.3.1)\n", "Requirement already satisfied: h11<0.15,>=0.13 in ./venv/lib/python3.11/site-packages (from httpcore==1.*->httpx>=0.24.1->gradio) (0.14.0)\n", "Requirement already satisfied: filelock in ./venv/lib/python3.11/site-packages (from huggingface-hub>=0.19.3->gradio) (3.14.0)\n", "Requirement already satisfied: requests in ./venv/lib/python3.11/site-packages (from huggingface-hub>=0.19.3->gradio) (2.31.0)\n", "Requirement already satisfied: tqdm>=4.42.1 in ./venv/lib/python3.11/site-packages (from huggingface-hub>=0.19.3->gradio) (4.66.4)\n", "Requirement already satisfied: contourpy>=1.0.1 in ./venv/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (1.2.1)\n", "Requirement already satisfied: cycler>=0.10 in ./venv/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\n", "Requirement already satisfied: fonttools>=4.22.0 in ./venv/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (4.51.0)\n", "Requirement already satisfied: kiwisolver>=1.3.1 in ./venv/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\n", "Requirement already satisfied: pyparsing>=2.3.1 in ./venv/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (3.1.2)\n", "Requirement already satisfied: python-dateutil>=2.7 in ./venv/lib/python3.11/site-packages (from matplotlib~=3.0->gradio) (2.9.0.post0)\n", "Requirement already satisfied: pytz>=2020.1 in ./venv/lib/python3.11/site-packages (from pandas<3.0,>=1.0->gradio) (2024.1)\n", "Requirement already satisfied: tzdata>=2022.7 in ./venv/lib/python3.11/site-packages (from pandas<3.0,>=1.0->gradio) (2024.1)\n", "Requirement already satisfied: annotated-types>=0.4.0 in ./venv/lib/python3.11/site-packages (from pydantic>=2.0->gradio) (0.6.0)\n", "Requirement already satisfied: pydantic-core==2.18.2 in ./venv/lib/python3.11/site-packages (from pydantic>=2.0->gradio) (2.18.2)\n", "Requirement already satisfied: click>=8.0.0 in ./venv/lib/python3.11/site-packages (from typer<1.0,>=0.12->gradio) (8.1.7)\n", "Requirement already satisfied: shellingham>=1.3.0 in ./venv/lib/python3.11/site-packages (from typer<1.0,>=0.12->gradio) (1.5.4)\n", "Requirement already satisfied: rich>=10.11.0 in ./venv/lib/python3.11/site-packages (from typer<1.0,>=0.12->gradio) (13.7.1)\n", "Requirement already satisfied: starlette<0.38.0,>=0.37.2 in ./venv/lib/python3.11/site-packages (from fastapi->gradio) (0.37.2)\n", "Requirement already satisfied: fastapi-cli>=0.0.2 in ./venv/lib/python3.11/site-packages (from fastapi->gradio) (0.0.4)\n", "Requirement already satisfied: ujson!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,>=4.0.1 in ./venv/lib/python3.11/site-packages (from fastapi->gradio) (5.10.0)\n", "Requirement already satisfied: email_validator>=2.0.0 in ./venv/lib/python3.11/site-packages (from fastapi->gradio) (2.1.1)\n", "Requirement already satisfied: dnspython>=2.0.0 in ./venv/lib/python3.11/site-packages (from email_validator>=2.0.0->fastapi->gradio) (2.6.1)\n", "Requirement already satisfied: attrs>=22.2.0 in ./venv/lib/python3.11/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.2.0)\n", "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in ./venv/lib/python3.11/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.12.1)\n", "Requirement already satisfied: referencing>=0.28.4 in ./venv/lib/python3.11/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.35.1)\n", "Requirement already satisfied: rpds-py>=0.7.1 in ./venv/lib/python3.11/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.18.1)\n", "Requirement already satisfied: six>=1.5 in ./venv/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in ./venv/lib/python3.11/site-packages (from rich>=10.11.0->typer<1.0,>=0.12->gradio) (3.0.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in ./venv/lib/python3.11/site-packages (from rich>=10.11.0->typer<1.0,>=0.12->gradio) (2.18.0)\n", "Requirement already satisfied: httptools>=0.5.0 in ./venv/lib/python3.11/site-packages (from uvicorn>=0.14.0->gradio) (0.6.1)\n", "Requirement already satisfied: python-dotenv>=0.13 in ./venv/lib/python3.11/site-packages (from uvicorn>=0.14.0->gradio) (1.0.1)\n", "Requirement already satisfied: uvloop!=0.15.0,!=0.15.1,>=0.14.0 in ./venv/lib/python3.11/site-packages (from uvicorn>=0.14.0->gradio) (0.19.0)\n", "Requirement already satisfied: watchfiles>=0.13 in ./venv/lib/python3.11/site-packages (from uvicorn>=0.14.0->gradio) (0.21.0)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in ./venv/lib/python3.11/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (3.3.2)\n", "Requirement already satisfied: mdurl~=0.1 in ./venv/lib/python3.11/site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer<1.0,>=0.12->gradio) (0.1.2)\n", "Note: you may need to restart the kernel to use updated packages.\n" ] } ], "source": [ "pip install gradio" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "id": "3nsunOhq9i6K" }, "outputs": [], "source": [ "import gradio as gr" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 715 }, "id": "wD4Jd7qg-ApE", "outputId": "734b3fcf-6440-4b4b-8405-2c3a830e8569", "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/user/Desktop/model/venv/lib/python3.11/site-packages/gradio/processing_utils.py:582: UserWarning: Trying to convert audio automatically from float64 to 16-bit int format.\n", " warnings.warn(warning.format(data.dtype))\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Running on local URL: http://127.0.0.1:7860\n", "\n", "To create a public link, set `share=True` in `launch()`.\n" ] }, { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Keyboard interruption in main thread... closing server.\n" ] }, { "data": { "text/plain": [] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def generate_audio():\n", " example = gtzan[\"train\"].shuffle()[0]\n", " audio = example[\"audio\"]\n", " return (\n", " audio[\"sampling_rate\"],\n", " audio[\"array\"],\n", " ), id2label_fn(example[\"genre\"])\n", "\n", "\n", "with gr.Blocks() as demo:\n", " with gr.Column():\n", " for _ in range(4):\n", " audio, label = generate_audio()\n", " output = gr.Audio(audio, label=label)\n", "\n", "demo.launch(debug=True)\n" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "id": "JUzgRS0J_DR8" }, "outputs": [], "source": [ "from transformers import AutoFeatureExtractor\n", "\n", "model_id = \"ntu-spml/distilhubert\"\n", "feature_extractor = AutoFeatureExtractor.from_pretrained(\n", " model_id, do_normalize=True, return_attention_mask=True\n", ")" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "rbQJMBRr_MJU", "outputId": "0c8010d9-ab10-4970-de54-173ab7fb03c9" }, "outputs": [ { "data": { "text/plain": [ "16000" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sampling_rate = feature_extractor.sampling_rate\n", "sampling_rate" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "id": "G_TXS3TE_Pom" }, "outputs": [], "source": [ "from datasets import Audio\n", "\n", "gtzan = gtzan.cast_column(\"audio\", Audio(sampling_rate=sampling_rate))" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "7VBWBOIv_VF9", "outputId": "d7564201-e814-45bc-8254-5e2eebaf65b8" }, "outputs": [ { "data": { "text/plain": [ "{'file': '/home/user/.cache/huggingface/datasets/downloads/extracted/8467212e1467f829ca8aa5be797cbd9704e95050d4c3e44235bb44dfacaa486f/genres/pop/pop.00098.wav',\n", " 'audio': {'path': '/home/user/.cache/huggingface/datasets/downloads/extracted/8467212e1467f829ca8aa5be797cbd9704e95050d4c3e44235bb44dfacaa486f/genres/pop/pop.00098.wav',\n", " 'array': array([ 0.0873509 , 0.20183384, 0.4790867 , ..., -0.18743178,\n", " -0.23294401, -0.13517427]),\n", " 'sampling_rate': 16000},\n", " 'genre': 7}" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gtzan[\"train\"][0]" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "uTogCiaS_Y4R", "outputId": "738eea16-68f8-4a0e-a8a3-6fbb3c21e69b" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mean: 0.000185, Variance: 0.0493\n" ] } ], "source": [ "import numpy as np\n", "\n", "sample = gtzan[\"train\"][0][\"audio\"]\n", "\n", "print(f\"Mean: {np.mean(sample['array']):.3}, Variance: {np.var(sample['array']):.3}\")" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "F_NLE8xQ_cj6", "outputId": "7d4aefe0-9249-4661-f80c-247d720bbac7" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "inputs keys: ['input_values', 'attention_mask']\n", "Mean: -7.45e-09, Variance: 1.0\n" ] } ], "source": [ "inputs = feature_extractor(sample[\"array\"], sampling_rate=sample[\"sampling_rate\"])\n", "\n", "print(f\"inputs keys: {list(inputs.keys())}\")\n", "\n", "print(\n", " f\"Mean: {np.mean(inputs['input_values']):.3}, Variance: {np.var(inputs['input_values']):.3}\"\n", ")" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "id": "QpQLm9B6_1FS" }, "outputs": [], "source": [ "max_duration = 30.0\n", "\n", "\n", "def preprocess_function(examples):\n", " audio_arrays = [x[\"array\"] for x in examples[\"audio\"]]\n", " inputs = feature_extractor(\n", " audio_arrays,\n", " sampling_rate=feature_extractor.sampling_rate,\n", " max_length=int(feature_extractor.sampling_rate * max_duration),\n", " truncation=True,\n", " return_attention_mask=True,\n", " )\n", " return inputs" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "VBMlZHdG_3qV", "outputId": "caef6ff5-ad09-4cf7-ae29-011966eaf285" }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "fde897eff7004793a268e47bab0aa2d2", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Map: 0%| | 0/899 [00:00 =1.17 in ./venv/lib/python3.11/site-packages (from accelerate) (1.26.4)\n", "Requirement already satisfied: packaging>=20.0 in ./venv/lib/python3.11/site-packages (from accelerate) (24.0)\n", "Requirement already satisfied: psutil in ./venv/lib/python3.11/site-packages (from accelerate) (5.9.8)\n", "Requirement already satisfied: pyyaml in ./venv/lib/python3.11/site-packages (from accelerate) (6.0.1)\n", "Requirement already satisfied: torch>=1.10.0 in ./venv/lib/python3.11/site-packages (from accelerate) (2.3.0)\n", "Requirement already satisfied: huggingface-hub in ./venv/lib/python3.11/site-packages (from accelerate) (0.23.0)\n", "Requirement already satisfied: safetensors>=0.3.1 in ./venv/lib/python3.11/site-packages (from accelerate) (0.4.3)\n", "Requirement already satisfied: filelock in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (3.14.0)\n", "Requirement already satisfied: typing-extensions>=4.8.0 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (4.11.0)\n", "Requirement already satisfied: sympy in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (1.12)\n", "Requirement already satisfied: networkx in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (3.3)\n", "Requirement already satisfied: jinja2 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (3.1.4)\n", "Requirement already satisfied: fsspec in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (2024.3.1)\n", "Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.1.105 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (12.1.105)\n", "Requirement already satisfied: nvidia-cuda-runtime-cu12==12.1.105 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (12.1.105)\n", "Requirement already satisfied: nvidia-cuda-cupti-cu12==12.1.105 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (12.1.105)\n", "Requirement already satisfied: nvidia-cudnn-cu12==8.9.2.26 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (8.9.2.26)\n", "Requirement already satisfied: nvidia-cublas-cu12==12.1.3.1 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (12.1.3.1)\n", "Requirement already satisfied: nvidia-cufft-cu12==11.0.2.54 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (11.0.2.54)\n", "Requirement already satisfied: nvidia-curand-cu12==10.3.2.106 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (10.3.2.106)\n", "Requirement already satisfied: nvidia-cusolver-cu12==11.4.5.107 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (11.4.5.107)\n", "Requirement already satisfied: nvidia-cusparse-cu12==12.1.0.106 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (12.1.0.106)\n", "Requirement already satisfied: nvidia-nccl-cu12==2.20.5 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (2.20.5)\n", "Requirement already satisfied: nvidia-nvtx-cu12==12.1.105 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (12.1.105)\n", "Requirement already satisfied: triton==2.3.0 in ./venv/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (2.3.0)\n", "Requirement already satisfied: nvidia-nvjitlink-cu12 in ./venv/lib/python3.11/site-packages (from nvidia-cusolver-cu12==11.4.5.107->torch>=1.10.0->accelerate) (12.4.127)\n", "Requirement already satisfied: requests in ./venv/lib/python3.11/site-packages (from huggingface-hub->accelerate) (2.31.0)\n", "Requirement already satisfied: tqdm>=4.42.1 in ./venv/lib/python3.11/site-packages (from huggingface-hub->accelerate) (4.66.4)\n", "Requirement already satisfied: MarkupSafe>=2.0 in ./venv/lib/python3.11/site-packages (from jinja2->torch>=1.10.0->accelerate) (2.1.5)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in ./venv/lib/python3.11/site-packages (from requests->huggingface-hub->accelerate) (3.3.2)\n", "Requirement already satisfied: idna<4,>=2.5 in ./venv/lib/python3.11/site-packages (from requests->huggingface-hub->accelerate) (3.7)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in ./venv/lib/python3.11/site-packages (from requests->huggingface-hub->accelerate) (2.2.1)\n", "Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.11/site-packages (from requests->huggingface-hub->accelerate) (2024.2.2)\n", "Requirement already satisfied: mpmath>=0.19 in ./venv/lib/python3.11/site-packages (from sympy->torch>=1.10.0->accelerate) (1.3.0)\n", "Note: you may need to restart the kernel to use updated packages.\n" ] } ], "source": [ "pip install accelerate" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "id": "4WBTkzyuCflX" }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 27, "metadata": { "id": "kntrjQoADPEK" }, "outputs": [], "source": [ "pip install -U transformers" ] }, { "cell_type": "code", "execution_count": 31, "metadata": { "id": "9OlgmAR8A0mG" }, "outputs": [], "source": [ "from transformers import TrainingArguments\n", "\n", "model_name = model_id.split(\"/\")[-1]\n", "batch_size = 8\n", "gradient_accumulation_steps = 1\n", "num_train_epochs = 10\n", "\n" ] }, { "cell_type": "code", "execution_count": 32, "metadata": { "id": "cv_Zd_jDC7gj" }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/user/Desktop/model/venv/lib/python3.11/site-packages/transformers/training_args.py:1489: FutureWarning: using `no_cuda` is deprecated and will be removed in version 5.0 of 🤗 Transformers. Use `use_cpu` instead\n", " warnings.warn(\n" ] } ], "source": [ "training_args = TrainingArguments(\n", " f\"{model_name}-finetuned-gtzan\",\n", " eval_strategy=\"epoch\",\n", " save_strategy=\"epoch\",\n", " learning_rate=5e-5,\n", " per_device_train_batch_size=batch_size,\n", " gradient_accumulation_steps=gradient_accumulation_steps,\n", " per_device_eval_batch_size=batch_size,\n", " num_train_epochs=num_train_epochs,\n", " warmup_ratio=0.1,\n", " logging_steps=5,\n", " load_best_model_at_end=True,\n", " metric_for_best_model=\"accuracy\",\n", " fp16=False,\n", " push_to_hub=True,\n", " no_cuda=True\n", ")\n" ] }, { "cell_type": "code", "execution_count": 30, "metadata": { "id": "QiawSGrUExT7" }, "outputs": [], "source": [ "pip install evaluate" ] }, { "cell_type": "code", "execution_count": 33, "metadata": { "id": "LpvB8n1bEvVf" }, "outputs": [], "source": [ "import evaluate\n", "import numpy as np\n", "\n", "metric = evaluate.load(\"accuracy\")\n", "\n", "\n", "def compute_metrics(eval_pred):\n", " \"\"\"Computes accuracy on a batch of predictions\"\"\"\n", " predictions = np.argmax(eval_pred.predictions, axis=1)\n", " return metric.compute(predictions=predictions, references=eval_pred.label_ids)" ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "id": "phMqgPQxE9yO" }, "outputs": [], "source": [ "from transformers import Trainer\n", "\n", "trainer = Trainer(\n", " model,\n", " training_args,\n", " train_dataset=gtzan_encoded[\"train\"],\n", " eval_dataset=gtzan_encoded[\"test\"],\n", " tokenizer=feature_extractor,\n", " compute_metrics=compute_metrics,\n", ")\n" ] }, { "cell_type": "code", "execution_count": 35, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 141 }, "id": "QKMe0MmDF8YA", "outputId": "990bc6fc-e340-49df-e110-ae151885313a" }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " \n", " [1130/1130 6:29:30, Epoch 10/10]\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
EpochTraining LossValidation LossAccuracy
11.9777001.9023880.530000
21.1820001.2809920.650000
31.0383001.0333110.690000
40.6542000.8852100.720000
50.5535000.7138980.800000
60.4759000.5840290.840000
70.2856000.5523400.830000
80.1450000.6314080.800000
90.2693000.5722150.820000
100.1714000.5892030.800000

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "TrainOutput(global_step=1130, training_loss=0.7772156888668516, metrics={'train_runtime': 23391.7714, 'train_samples_per_second': 0.384, 'train_steps_per_second': 0.048, 'total_flos': 6.133988274624e+17, 'train_loss': 0.7772156888668516, 'epoch': 10.0})" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trainer.train()" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [], "source": [ "kwargs = {\n", " \"dataset_tags\": \"marsyas/gtzan\",\n", " \"dataset\": \"GTZAN\",\n", " \"model_name\": f\"{model_name}-finetuned-gtzan\",\n", " \"finetuned_from\": model_id,\n", " \"tasks\": \"audio-classification\",\n", "}\n" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "CommitInfo(commit_url='https://huggingface.co/RiKrim/distilhubert-finetuned-gtzan/commit/e461b6291a9d20525c7079e316d8df42dcbd141c', commit_message='End of training', commit_description='', oid='e461b6291a9d20525c7079e316d8df42dcbd141c', pr_url=None, pr_revision=None, pr_num=None)" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trainer.push_to_hub(**kwargs)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "colab": { "provenance": [] }, "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.6" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "00bfd21bca544c47bea6da0e0ce3487f": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "046b245d59fa456c806d3a74e16e6daa": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "0dda3266d3ea493e83e3b1cf47f6524e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "216d9091b816416f81033ef201d98bea": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "227494428333441b891020e6f87b338b": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_fc03fa730876435487990cec90250e25", "placeholder": "​", "style": "IPY_MODEL_c1d6265183ba43d2935f5feff79187b7", "value": "


Copy a token from your Hugging Face\ntokens page and paste it below.
Immediately click login after copying\nyour token or it might be stored in plain text in this notebook file.
" } }, "289042798aa0494282fd02f8253e8764": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "30df2beaf92d4d4ea31e5501918f07ba": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "335b02d36d1d4195a6bae34d480c8e5c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "50ba98fdb9ed47d1b6108c7aa4f1b088": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ButtonModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ButtonModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ButtonView", "button_style": "", "description": "Login", "disabled": false, "icon": "", "layout": "IPY_MODEL_8b6b79964e2042d8a853510727e2e34f", "style": "IPY_MODEL_5640b91b99ed4e3c8182266e52a86ca8", "tooltip": "" } }, "5326b1b1e1094e55b7f1f3ceeb44621c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_5b7df71497b84943a7fabd68b9fdf031", "placeholder": "​", "style": "IPY_MODEL_faf2939133e54dffaa208a75c257d0d3", "value": "\nPro Tip: If you don't already have one, you can create a dedicated\n'notebooks' token with 'write' access, that you can then easily reuse for all\nnotebooks. " } }, "5640b91b99ed4e3c8182266e52a86ca8": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ButtonStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ButtonStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "button_color": null, "font_weight": "" } }, "5b7df71497b84943a7fabd68b9fdf031": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "5f5bce14ffd54ce6aaddf7eee06b0780": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "VBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "VBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "VBoxView", "box_style": "", "children": [ "IPY_MODEL_5fe3ce149760495482ed27d4437f948e", "IPY_MODEL_cdd0a406c34c49d495c83768bf277552", "IPY_MODEL_d565aba281334aefa921962b6f641379", "IPY_MODEL_ddbd15cd160847d7ad8c373c027bea5e" ], "layout": "IPY_MODEL_7bbce34b8ce5468eb7ef98efcba9ae70" } }, "5fe3ce149760495482ed27d4437f948e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "LabelModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "LabelModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "LabelView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_6b057e0d7c404cf1bea422f48e4781e8", "placeholder": "​", "style": "IPY_MODEL_f4bdef5898794847bc0c97ca759b8037", "value": "Token is valid (permission: fineGrained)." } }, "636229e44fd44ad699a1eaf2339752ad": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "6a028ea873874b20b6cf7928ccd84538": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "6b057e0d7c404cf1bea422f48e4781e8": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "7bbce34b8ce5468eb7ef98efcba9ae70": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": "center", "align_self": null, "border": null, "bottom": null, "display": "flex", "flex": null, "flex_flow": "column", "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "50%" } }, "7c014d81820d4f598a26a9c28a558a0c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "LabelModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "LabelModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "LabelView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_636229e44fd44ad699a1eaf2339752ad", "placeholder": "​", "style": "IPY_MODEL_335b02d36d1d4195a6bae34d480c8e5c", "value": "Connecting..." } }, "8b6b79964e2042d8a853510727e2e34f": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a0aca0338dec449b88c8285d1f0cbef7": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "CheckboxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "CheckboxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "CheckboxView", "description": "Add token as git credential?", "description_tooltip": null, "disabled": false, "indent": true, "layout": "IPY_MODEL_30df2beaf92d4d4ea31e5501918f07ba", "style": "IPY_MODEL_d96f88c9819440d29611539bd2890260", "value": true } }, "c1d6265183ba43d2935f5feff79187b7": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "c7ff28fb537347e09acaf84f23eea5ba": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "cdd0a406c34c49d495c83768bf277552": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "LabelModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "LabelModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "LabelView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_6a028ea873874b20b6cf7928ccd84538", "placeholder": "​", "style": "IPY_MODEL_046b245d59fa456c806d3a74e16e6daa", "value": "Your token has been saved in your configured git credential helpers (store)." } }, "d565aba281334aefa921962b6f641379": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "LabelModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "LabelModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "LabelView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_ff30d5707c0048058bf66f4d7cacaa53", "placeholder": "​", "style": "IPY_MODEL_289042798aa0494282fd02f8253e8764", "value": "Your token has been saved to /root/.cache/huggingface/token" } }, "d96f88c9819440d29611539bd2890260": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "ddbd15cd160847d7ad8c373c027bea5e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "LabelModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "LabelModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "LabelView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c7ff28fb537347e09acaf84f23eea5ba", "placeholder": "​", "style": "IPY_MODEL_0dda3266d3ea493e83e3b1cf47f6524e", "value": "Login successful" } }, "f0bb2256813f416194677eb338417868": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "PasswordModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "PasswordModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "PasswordView", "continuous_update": true, "description": "Token:", "description_tooltip": null, "disabled": false, "layout": "IPY_MODEL_00bfd21bca544c47bea6da0e0ce3487f", "placeholder": "​", "style": "IPY_MODEL_216d9091b816416f81033ef201d98bea", "value": "" } }, "f4bdef5898794847bc0c97ca759b8037": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "faf2939133e54dffaa208a75c257d0d3": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "fc03fa730876435487990cec90250e25": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "ff30d5707c0048058bf66f4d7cacaa53": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } } } } }, "nbformat": 4, "nbformat_minor": 4 }