{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Text task notebook template\n", "## Loading the necessary libraries" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[codecarbon WARNING @ 19:48:07] Multiple instances of codecarbon are allowed to run at the same time.\n", "[codecarbon INFO @ 19:48:07] [setup] RAM Tracking...\n", "[codecarbon INFO @ 19:48:07] [setup] CPU Tracking...\n", "[codecarbon WARNING @ 19:48:09] We saw that you have a 13th Gen Intel(R) Core(TM) i7-1365U but we don't know it. Please contact us.\n", "[codecarbon WARNING @ 19:48:09] No CPU tracking mode found. Falling back on CPU constant mode. \n", " Windows OS detected: Please install Intel Power Gadget to measure CPU\n", "\n", "[codecarbon WARNING @ 19:48:11] We saw that you have a 13th Gen Intel(R) Core(TM) i7-1365U but we don't know it. Please contact us.\n", "[codecarbon INFO @ 19:48:11] CPU Model on constant consumption mode: 13th Gen Intel(R) Core(TM) i7-1365U\n", "[codecarbon WARNING @ 19:48:11] No CPU tracking mode found. Falling back on CPU constant mode.\n", "[codecarbon INFO @ 19:48:11] [setup] GPU Tracking...\n", "[codecarbon INFO @ 19:48:11] No GPU found.\n", "[codecarbon INFO @ 19:48:11] >>> Tracker's metadata:\n", "[codecarbon INFO @ 19:48:11] Platform system: Windows-11-10.0.22631-SP0\n", "[codecarbon INFO @ 19:48:11] Python version: 3.12.7\n", "[codecarbon INFO @ 19:48:11] CodeCarbon version: 3.0.0_rc0\n", "[codecarbon INFO @ 19:48:11] Available RAM : 31.347 GB\n", "[codecarbon INFO @ 19:48:11] CPU count: 12\n", "[codecarbon INFO @ 19:48:11] CPU model: 13th Gen Intel(R) Core(TM) i7-1365U\n", "[codecarbon INFO @ 19:48:11] GPU count: None\n", "[codecarbon INFO @ 19:48:11] GPU model: None\n", "[codecarbon INFO @ 19:48:11] Saving emissions data to file c:\\git\\submission-template\\notebooks\\emissions.csv\n" ] } ], "source": [ "from fastapi import APIRouter\n", "from datetime import datetime\n", "from datasets import load_dataset\n", "from sklearn.metrics import accuracy_score\n", "import random\n", "\n", "import sys\n", "sys.path.append('../tasks')\n", "\n", "from utils.evaluation import AudioEvaluationRequest\n", "from utils.emissions import tracker, clean_emissions_data, get_space_info\n", "\n", "\n", "# Define the label mapping\n", "LABEL_MAPPING = {\n", " \"chainsaw\": 0,\n", " \"environment\": 1\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Loading the datasets and splitting them" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "668da7bf85434e098b95c3ec447d78fe", "version_major": 2, "version_minor": 0 }, "text/plain": [ "README.md: 0%| | 0.00/5.18k [00:00