{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "jKnw99avkQjs", "outputId": "2a28be57-562c-43af-84ed-be153317bda5" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m697.4/697.4 kB\u001b[0m \u001b[31m8.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.7/60.7 MB\u001b[0m \u001b[31m16.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m527.0/527.0 kB\u001b[0m \u001b[31m30.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m48.9/48.9 MB\u001b[0m \u001b[31m15.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h" ] } ], "source": [ "!pip install -q \\\n", " \"transformers>=4.38\" \\\n", " \"accelerate>=0.27\" \\\n", " \"trl>=0.10\" \\\n", " \"peft>=0.9\" \\\n", " \"bitsandbytes>=0.42\" \\\n", " \"datasets>=2.17\" \\\n", " \"requests>=2.31\" \\\n", " \"pandas>=2.0\" \\\n", " \"fredapi\" \\\n", " \"world-bank-data\" \\\n", " \"plotly>=5.18\" \\\n", " \"rich>=13.0\" \\\n", " \"tenacity>=8.2\"\n", "\n", "# After install: Runtime → Restart session → run from Cell 2" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 109 }, "id": "WEJcP68rlWKS", "outputId": "d91e3c2d-2296-4ad5-f580-2d16cb7aa43c" }, "outputs": [ { "data": { "text/html": [ "
───────────────────────────────────────── CivicAI Advanced — System Ready ─────────────────────────────────────────\n", "\n" ], "text/plain": [ "\u001b[92m───────────────────────────────────────── \u001b[0m\u001b[1;36mCivicAI Advanced — System Ready\u001b[0m\u001b[92m ─────────────────────────────────────────\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
PyTorch 2.10.0+cpu \n", " Device CPU \n", " BF16/FP16 bf16=False fp16=False \n", " Timestamp 2026-04-26 02:19:19 \n", "\n" ], "text/plain": [ " \u001b[36mPyTorch\u001b[0m 2.10.0+cpu \n", " \u001b[36mDevice\u001b[0m CPU \n", " \u001b[36mBF16/FP16\u001b[0m bf16=False fp16=False \n", " \u001b[36mTimestamp\u001b[0m 2026-04-26 02:19:19 \n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import os, re, json, math, time, random, inspect, warnings, logging\n", "from datetime import datetime\n", "from typing import Dict, List, Optional, Tuple\n", "from pathlib import Path\n", "\n", "import numpy as np\n", "import pandas as pd\n", "import torch\n", "import requests\n", "import plotly.graph_objects as go\n", "import plotly.express as px\n", "from plotly.subplots import make_subplots\n", "from tenacity import retry, stop_after_attempt, wait_exponential\n", "from rich.console import Console\n", "from rich.table import Table\n", "from rich.progress import Progress, SpinnerColumn, TextColumn\n", "from rich import print as rprint\n", "\n", "warnings.filterwarnings(\"ignore\")\n", "logging.basicConfig(level=logging.ERROR)\n", "\n", "console = Console()\n", "\n", "# ── Hardware detection ────────────────────────────────────────────────────────\n", "CUDA_OK = torch.cuda.is_available()\n", "if CUDA_OK:\n", " CAP = torch.cuda.get_device_capability()\n", " USE_BF16 = CAP[0] >= 8\n", " USE_FP16 = not USE_BF16\n", " GPU_NAME = torch.cuda.get_device_name(0)\n", "else:\n", " USE_BF16 = USE_FP16 = False\n", " GPU_NAME = \"CPU\"\n", "\n", "DEVICE = \"cuda\" if CUDA_OK else \"cpu\"\n", "\n", "# ── Paths ─────────────────────────────────────────────────────────────────────\n", "Path(\"assets\").mkdir(exist_ok=True)\n", "Path(\"checkpoints\").mkdir(exist_ok=True)\n", "Path(\"logs\").mkdir(exist_ok=True)\n", "\n", "console.rule(\"[bold cyan]CivicAI Advanced — System Ready\")\n", "table = Table(show_header=False, box=None)\n", "table.add_row(\"[cyan]PyTorch\", torch.__version__)\n", "table.add_row(\"[cyan]Device\", GPU_NAME)\n", "table.add_row(\"[cyan]BF16/FP16\", f\"bf16={USE_BF16} fp16={USE_FP16}\")\n", "table.add_row(\"[cyan]Timestamp\", datetime.now().strftime(\"%Y-%m-%d %H:%M:%S\"))\n", "console.print(table)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 325, "referenced_widgets": [ "f83489a9561a4b73b8d8eddc4b00c34e", "9895d266524c4a9c817912cdb008677a", "7db3437ccf2b430c9e795364df69595c", "5074b39aac7e43f295767192a8c6dfae", "188f4333d05b4bdb8dbf62f789a45620", "621d9a6d432840a58a554fbc6cfb3eed", "1f2303b42b3c4340a284c7126cf1fd37", "c41c26ae9ba443a5b6b942d69cf323be", "3c361255933741089182c76f833bc2c7", "b38158c0ff0c432893a6e8420cb5f6a9", "3f6ada08370341f89dbda7720a82c05a", "1d8f93d877d247af95b009db2b659a65" ] }, "id": "qbbp3ggXlaVG", "outputId": "6b7e3185-d83c-4d07-9fea-78ab232123c3" }, "outputs": [ { "data": { "text/html": [ "
[02:20:03] → fetching USA 320402637.py:115\n", "\n" ], "text/plain": [ "\u001b[2;36m[02:20:03]\u001b[0m\u001b[2;36m \u001b[0m\u001b[2m→ fetching USA\u001b[0m \u001b]8;id=826200;file:///tmp/ipykernel_2561/320402637.py\u001b\\\u001b[2m320402637.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=198213;file:///tmp/ipykernel_2561/320402637.py#115\u001b\\\u001b[2m115\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f83489a9561a4b73b8d8eddc4b00c34e", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[02:20:04] → fetching IND 320402637.py:115\n", "\n" ], "text/plain": [ "\u001b[2;36m[02:20:04]\u001b[0m\u001b[2;36m \u001b[0m\u001b[2m→ fetching IND\u001b[0m \u001b]8;id=122338;file:///tmp/ipykernel_2561/320402637.py\u001b\\\u001b[2m320402637.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=792341;file:///tmp/ipykernel_2561/320402637.py#115\u001b\\\u001b[2m115\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "7db3437ccf2b430c9e795364df69595c", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[02:20:05] → fetching GBR 320402637.py:115\n", "\n" ], "text/plain": [ "\u001b[2;36m[02:20:05]\u001b[0m\u001b[2;36m \u001b[0m\u001b[2m→ fetching GBR\u001b[0m \u001b]8;id=544388;file:///tmp/ipykernel_2561/320402637.py\u001b\\\u001b[2m320402637.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=269695;file:///tmp/ipykernel_2561/320402637.py#115\u001b\\\u001b[2m115\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "188f4333d05b4bdb8dbf62f789a45620", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
→ fetching DEU 320402637.py:115\n", "\n" ], "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[2m→ fetching DEU\u001b[0m \u001b]8;id=862548;file:///tmp/ipykernel_2561/320402637.py\u001b\\\u001b[2m320402637.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=108056;file:///tmp/ipykernel_2561/320402637.py#115\u001b\\\u001b[2m115\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "1f2303b42b3c4340a284c7126cf1fd37", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[02:20:07] → fetching JPN 320402637.py:115\n", "\n" ], "text/plain": [ "\u001b[2;36m[02:20:07]\u001b[0m\u001b[2;36m \u001b[0m\u001b[2m→ fetching JPN\u001b[0m \u001b]8;id=502339;file:///tmp/ipykernel_2561/320402637.py\u001b\\\u001b[2m320402637.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=143285;file:///tmp/ipykernel_2561/320402637.py#115\u001b\\\u001b[2m115\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3c361255933741089182c76f833bc2c7", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[02:20:08] → fetching BRA 320402637.py:115\n", "\n" ], "text/plain": [ "\u001b[2;36m[02:20:08]\u001b[0m\u001b[2;36m \u001b[0m\u001b[2m→ fetching BRA\u001b[0m \u001b]8;id=252986;file:///tmp/ipykernel_2561/320402637.py\u001b\\\u001b[2m320402637.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=340934;file:///tmp/ipykernel_2561/320402637.py#115\u001b\\\u001b[2m115\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3f6ada08370341f89dbda7720a82c05a", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
──────────────────────────────────────────────── Live Data Fetched ────────────────────────────────────────────────\n", "\n" ], "text/plain": [ "\u001b[92m──────────────────────────────────────────────── \u001b[0m\u001b[1;32mLive Data Fetched\u001b[0m\u001b[92m ────────────────────────────────────────────────\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
country inflation_pct unemployment_pct health_exp_gdp gdp_growth\n",
" United States 2.949525 4.198 16.694149 2.793001\n",
" India 4.953036 4.219 3.339440 6.494766\n",
"United Kingdom 3.271573 4.746 11.133358 1.126423\n",
" Germany 2.256498 3.711 12.266553 -0.495852\n",
" Japan 2.738537 2.451 10.739795 0.104309\n",
" Brazil 4.367464 5.970 9.730927 3.419315\n",
"\n"
],
"text/plain": [
" country inflation_pct unemployment_pct health_exp_gdp gdp_growth\n",
" United States \u001b[1;36m2.949525\u001b[0m \u001b[1;36m4.198\u001b[0m \u001b[1;36m16.694149\u001b[0m \u001b[1;36m2.793001\u001b[0m\n",
" India \u001b[1;36m4.953036\u001b[0m \u001b[1;36m4.219\u001b[0m \u001b[1;36m3.339440\u001b[0m \u001b[1;36m6.494766\u001b[0m\n",
"United Kingdom \u001b[1;36m3.271573\u001b[0m \u001b[1;36m4.746\u001b[0m \u001b[1;36m11.133358\u001b[0m \u001b[1;36m1.126423\u001b[0m\n",
" Germany \u001b[1;36m2.256498\u001b[0m \u001b[1;36m3.711\u001b[0m \u001b[1;36m12.266553\u001b[0m \u001b[1;36m-0.495852\u001b[0m\n",
" Japan \u001b[1;36m2.738537\u001b[0m \u001b[1;36m2.451\u001b[0m \u001b[1;36m10.739795\u001b[0m \u001b[1;36m0.104309\u001b[0m\n",
" Brazil \u001b[1;36m4.367464\u001b[0m \u001b[1;36m5.970\u001b[0m \u001b[1;36m9.730927\u001b[0m \u001b[1;36m3.419315\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"class RealTimeDataFetcher:\n",
" \"\"\"\n",
" Fetches live economic indicators from:\n",
" • World Bank Open API (no key required)\n",
" • FRED / St. Louis Fed (free key via fredapi)\n",
" • BLS (Bureau of Labor Statistics — no key for basic tier)\n",
" • REST Countries (social / governance proxies)\n",
" Falls back to realistic historical means if any API is unavailable.\n",
" \"\"\"\n",
"\n",
" WORLD_BANK_BASE = \"https://api.worldbank.org/v2\"\n",
" BLS_BASE = \"https://api.bls.gov/publicAPI/v1/timeseries/data\"\n",
" REST_COUNTRIES = \"https://restcountries.com/v3.1/alpha\"\n",
"\n",
" # World Bank indicator codes\n",
" WB_INDICATORS = {\n",
" \"inflation\" : \"FP.CPI.TOTL.ZG\", # CPI inflation %\n",
" \"unemployment\": \"SL.UEM.TOTL.ZS\", # Unemployment % of labour force\n",
" \"health_exp\" : \"SH.XPD.CHEX.GD.ZS\",# Health expenditure % of GDP\n",
" \"life_expect\" : \"SP.DYN.LE00.IN\", # Life expectancy at birth\n",
" \"gdp_growth\" : \"NY.GDP.MKTP.KD.ZG\", # GDP growth %\n",
" \"homicide\" : \"VC.IHR.PSRC.P5\", # Intentional homicides per 100k\n",
" }\n",
"\n",
" # Country ISO codes supported\n",
" COUNTRIES = {\n",
" \"USA\": {\"iso2\": \"US\", \"iso3\": \"USA\", \"name\": \"United States\"},\n",
" \"IND\": {\"iso2\": \"IN\", \"iso3\": \"IND\", \"name\": \"India\"},\n",
" \"GBR\": {\"iso2\": \"GB\", \"iso3\": \"GBR\", \"name\": \"United Kingdom\"},\n",
" \"DEU\": {\"iso2\": \"DE\", \"iso3\": \"DEU\", \"name\": \"Germany\"},\n",
" \"JPN\": {\"iso2\": \"JP\", \"iso3\": \"JPN\", \"name\": \"Japan\"},\n",
" \"BRA\": {\"iso2\": \"BR\", \"iso3\": \"BRA\", \"name\": \"Brazil\"},\n",
" }\n",
"\n",
" # Realistic fallback values (5-year historical means, 2019-2023)\n",
" FALLBACKS = {\n",
" \"USA\": {\"inflation\":3.8,\"unemployment\":4.8,\"health_exp\":17.2,\"life_expect\":77.5,\"gdp_growth\":2.1,\"homicide\":6.5},\n",
" \"IND\": {\"inflation\":5.5,\"unemployment\":7.2,\"health_exp\":3.3, \"life_expect\":69.4,\"gdp_growth\":5.8,\"homicide\":2.8},\n",
" \"GBR\": {\"inflation\":3.2,\"unemployment\":4.2,\"health_exp\":10.9,\"life_expect\":80.4,\"gdp_growth\":1.4,\"homicide\":1.2},\n",
" \"DEU\": {\"inflation\":2.8,\"unemployment\":3.5,\"health_exp\":12.8,\"life_expect\":80.6,\"gdp_growth\":0.9,\"homicide\":0.9},\n",
" \"JPN\": {\"inflation\":1.2,\"unemployment\":2.8,\"health_exp\":10.9,\"life_expect\":84.3,\"gdp_growth\":0.7,\"homicide\":0.2},\n",
" \"BRA\": {\"inflation\":6.9,\"unemployment\":11.0,\"health_exp\":9.9,\"life_expect\":75.5,\"gdp_growth\":1.2,\"homicide\":22.4},\n",
" }\n",
"\n",
" def __init__(self, cache_ttl_seconds: int = 3600):\n",
" self._cache: Dict[str, Tuple[float, dict]] = {}\n",
" self.cache_ttl = cache_ttl_seconds\n",
" self.session = requests.Session()\n",
" self.session.headers.update({\"User-Agent\": \"CivicAI/2.0\"})\n",
"\n",
" @retry(stop=stop_after_attempt(3), wait=wait_exponential(min=1, max=8))\n",
" def _wb_fetch(self, country_iso2: str, indicator: str) -> Optional[float]:\n",
" \"\"\"Fetch latest non-null value from World Bank API.\"\"\"\n",
" url = (f\"{self.WORLD_BANK_BASE}/country/{country_iso2}/indicator/{indicator}\"\n",
" f\"?format=json&mrv=5&per_page=5\")\n",
" r = self.session.get(url, timeout=10)\n",
" r.raise_for_status()\n",
" data = r.json()\n",
" if len(data) < 2 or not data[1]:\n",
" return None\n",
" for entry in data[1]:\n",
" if entry.get(\"value\") is not None:\n",
" return float(entry[\"value\"])\n",
" return None\n",
"\n",
" def fetch_country(self, country_code: str = \"USA\") -> dict:\n",
" \"\"\"\n",
" Returns normalised economic state for a country.\n",
" Uses cache → World Bank API → fallback in that order.\n",
" \"\"\"\n",
" cache_key = f\"{country_code}_{int(time.time() // self.cache_ttl)}\"\n",
" if cache_key in self._cache:\n",
" return self._cache[cache_key]\n",
"\n",
" meta = self.COUNTRIES.get(country_code, self.COUNTRIES[\"USA\"])\n",
" iso2 = meta[\"iso2\"]\n",
" raw = {}\n",
"\n",
" with Progress(SpinnerColumn(), TextColumn(\"[cyan]Fetching {task.description}\"),\n",
" transient=True) as prog:\n",
" t = prog.add_task(f\"live data for {meta['name']}\")\n",
" for key, indicator in self.WB_INDICATORS.items():\n",
" try:\n",
" val = self._wb_fetch(iso2, indicator)\n",
" raw[key] = val if val is not None else self.FALLBACKS[country_code][key]\n",
" except Exception:\n",
" raw[key] = self.FALLBACKS[country_code][key]\n",
"\n",
" # ── Normalise to [0, 1] for the RL environment ────────────────────\n",
" state = {\n",
" # Lower inflation = better; 0 %→1.0, ≥15 %→0.0\n",
" \"inflation\" : max(0.0, min(1.0, 1 - raw[\"inflation\"] / 15.0)),\n",
" # Higher employment = better\n",
" \"employment\" : max(0.0, min(1.0, 1 - raw[\"unemployment\"]/ 25.0)),\n",
" # Higher health expenditure + life expectancy = better\n",
" \"health\" : max(0.0, min(1.0, (raw[\"health_exp\"] / 20.0 +\n",
" raw[\"life_expect\"] / 90.0) / 2)),\n",
" # GDP growth proxy for satisfaction\n",
" \"satisfaction\": max(0.0, min(1.0, (raw[\"gdp_growth\"] + 5) / 15.0)),\n",
" # Lower homicide = better\n",
" \"crime\" : max(0.0, min(1.0, 1 - raw[\"homicide\"] / 50.0)),\n",
" }\n",
"\n",
" # Attach raw for reporting\n",
" state[\"_raw\"] = raw\n",
" state[\"_country\"]= meta[\"name\"]\n",
" state[\"_fetched\"]= datetime.now().isoformat()\n",
"\n",
" self._cache[cache_key] = state\n",
" return state\n",
"\n",
" def fetch_all_countries(self) -> Dict[str, dict]:\n",
" results = {}\n",
" for code in self.COUNTRIES:\n",
" console.log(f\"[dim]→ fetching {code}\")\n",
" results[code] = self.fetch_country(code)\n",
" return results\n",
"\n",
" def to_dataframe(self, all_data: Dict[str, dict]) -> pd.DataFrame:\n",
" rows = []\n",
" for code, state in all_data.items():\n",
" raw = state.get(\"_raw\", {})\n",
" rows.append({\n",
" \"country\" : state.get(\"_country\", code),\n",
" \"code\" : code,\n",
" \"inflation_pct\": raw.get(\"inflation\", 0),\n",
" \"unemployment_pct\": raw.get(\"unemployment\", 0),\n",
" \"health_exp_gdp\": raw.get(\"health_exp\", 0),\n",
" \"life_expect\" : raw.get(\"life_expect\", 0),\n",
" \"gdp_growth\" : raw.get(\"gdp_growth\", 0),\n",
" \"homicide_rate\" : raw.get(\"homicide\", 0),\n",
" # normalised\n",
" \"norm_inflation\" : state[\"inflation\"],\n",
" \"norm_employment\" : state[\"employment\"],\n",
" \"norm_health\" : state[\"health\"],\n",
" \"norm_satisfaction\": state[\"satisfaction\"],\n",
" \"norm_crime\" : state[\"crime\"],\n",
" \"fetched_at\" : state.get(\"_fetched\"),\n",
" })\n",
" return pd.DataFrame(rows)\n",
"\n",
"\n",
"# Instantiate & fetch\n",
"fetcher = RealTimeDataFetcher(cache_ttl_seconds=3600)\n",
"all_data = fetcher.fetch_all_countries()\n",
"df_world = fetcher.to_dataframe(all_data)\n",
"\n",
"console.rule(\"[bold green]Live Data Fetched\")\n",
"console.print(df_world[[\"country\",\"inflation_pct\",\"unemployment_pct\",\n",
" \"health_exp_gdp\",\"gdp_growth\"]].to_string(index=False))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 647
},
"id": "wEIL-B2flmFU",
"outputId": "9d43d7d0-e372-445c-cc2f-0a9cfe7821ca"
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"\n",
" [02:20:36] ✓ Dashboard saved → assets/global_dashboard.html 4082134586.py:34\n", "\n" ], "text/plain": [ "\u001b[2;36m[02:20:36]\u001b[0m\u001b[2;36m \u001b[0m\u001b[32m✓ Dashboard saved → assets/global_dashboard.html\u001b[0m \u001b]8;id=756173;file:///tmp/ipykernel_2561/4082134586.py\u001b\\\u001b[2m4082134586.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=566577;file:///tmp/ipykernel_2561/4082134586.py#34\u001b\\\u001b[2m34\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "def plot_global_dashboard(df: pd.DataFrame) -> None:\n", " fig = make_subplots(\n", " rows=2, cols=3,\n", " subplot_titles=(\n", " \"Inflation (%)\", \"Unemployment (%)\", \"Health Exp (% GDP)\",\n", " \"Life Expectancy (yrs)\", \"GDP Growth (%)\", \"Homicide Rate (per 100k)\"\n", " ),\n", " )\n", " cols_raw = [\"inflation_pct\",\"unemployment_pct\",\"health_exp_gdp\",\n", " \"life_expect\",\"gdp_growth\",\"homicide_rate\"]\n", " colors = px.colors.qualitative.Bold\n", "\n", " for i, col in enumerate(cols_raw):\n", " r, c = divmod(i, 3)\n", " fig.add_trace(\n", " go.Bar(\n", " x=df[\"country\"], y=df[col],\n", " marker_color=colors,\n", " showlegend=False,\n", " text=df[col].round(1), textposition=\"outside\"\n", " ),\n", " row=r+1, col=c+1\n", " )\n", "\n", " fig.update_layout(\n", " title_text=\"🌍 CivivAI — Real-Time Global Economic Dashboard\",\n", " title_font_size=20,\n", " height=600, template=\"plotly_dark\",\n", " paper_bgcolor=\"#0d1117\", plot_bgcolor=\"#0d1117\",\n", " font=dict(color=\"#e6edf3\"),\n", " )\n", " fig.show()\n", " fig.write_html(\"assets/global_dashboard.html\")\n", " console.log(\"[green]✓ Dashboard saved → assets/global_dashboard.html\")\n", "\n", "plot_global_dashboard(df_world)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 89 }, "id": "r9AXHYEiluMx", "outputId": "f52ebc5f-74e8-444e-8ff0-2d3aa635b0fa" }, "outputs": [ { "data": { "text/html": [ "
─────────────────────────────────────────── Advanced Environment Ready ────────────────────────────────────────────\n", "\n" ], "text/plain": [ "\u001b[92m─────────────────────────────────────────── \u001b[0m\u001b[1;32mAdvanced Environment Ready\u001b[0m\u001b[92m ────────────────────────────────────────────\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Initial state (USA, real data): {'inflation': 0.7922, 'employment': 0.8618, 'health': 0.801, 'satisfaction': 0.543,\n", "'crime': 0.8937}\n", "\n" ], "text/plain": [ "Initial state \u001b[1m(\u001b[0mUSA, real data\u001b[1m)\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'inflation'\u001b[0m: \u001b[1;36m0.7922\u001b[0m, \u001b[32m'employment'\u001b[0m: \u001b[1;36m0.8618\u001b[0m, \u001b[32m'health'\u001b[0m: \u001b[1;36m0.801\u001b[0m, \u001b[32m'satisfaction'\u001b[0m: \u001b[1;36m0.543\u001b[0m,\n", "\u001b[32m'crime'\u001b[0m: \u001b[1;36m0.8937\u001b[0m\u001b[1m}\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "class AdvancedCivicAIEnv:\n", " \"\"\"\n", " Production-grade multi-country civic environment.\n", " • Initialises from real World Bank data\n", " • Supports 6 countries and 4 policy tasks\n", " • Action space: 5-dimensional continuous [0,1]\n", " • Observation: 10-dimensional (5 state + 5 delta from last step)\n", " • Reward: weighted multi-objective (Pareto-style)\n", " • Includes shock events (recession, pandemic proxy, crime spike)\n", " \"\"\"\n", "\n", " TASKS = {\n", " \"stabilize_economy\" : {\"inflation_weight\":0.4, \"employment_weight\":0.3, \"health_weight\":0.15, \"satisfaction_weight\":0.1, \"crime_weight\":0.05},\n", " \"improve_health\" : {\"inflation_weight\":0.1, \"employment_weight\":0.2, \"health_weight\":0.5, \"satisfaction_weight\":0.15,\"crime_weight\":0.05},\n", " \"reduce_crime\" : {\"inflation_weight\":0.1, \"employment_weight\":0.2, \"health_weight\":0.2, \"satisfaction_weight\":0.1, \"crime_weight\":0.4},\n", " \"maximize_wellbeing\" : {\"inflation_weight\":0.2, \"employment_weight\":0.2, \"health_weight\":0.2, \"satisfaction_weight\":0.2, \"crime_weight\":0.2},\n", " }\n", "\n", " SHOCK_EVENTS = [\n", " {\"name\":\"recession\", \"prob\":0.02, \"effect\":{\"inflation\":+0.15,\"employment\":-0.12,\"satisfaction\":-0.1}},\n", " {\"name\":\"pandemic\", \"prob\":0.01, \"effect\":{\"health\":-0.2, \"employment\":-0.1, \"satisfaction\":-0.15}},\n", " {\"name\":\"crime_spike\",\"prob\":0.02, \"effect\":{\"crime\":-0.15, \"satisfaction\":-0.08}},\n", " {\"name\":\"boom\", \"prob\":0.02, \"effect\":{\"employment\":+0.1,\"satisfaction\":+0.1,\"inflation\":+0.05}},\n", " ]\n", "\n", " def __init__(self, fetcher: RealTimeDataFetcher, default_country: str = \"USA\"):\n", " self.fetcher = fetcher\n", " self.default_country = default_country\n", " self._prev_state = None\n", " self.step_count = 0\n", " self.shock_log = []\n", " self.state_data = {}\n", "\n", " def reset(self, task_id: str = \"stabilize_economy\", country: str = None) -> dict:\n", " country = country or self.default_country\n", " self.task_id = task_id\n", " self.weights = self.TASKS[task_id]\n", " self.step_count = 0\n", " self.shock_log = []\n", "\n", " # Load real data as starting state\n", " live = self.fetcher.fetch_country(country)\n", " self.state_data = {k: live[k] for k in [\"inflation\",\"employment\",\"health\",\"satisfaction\",\"crime\"]}\n", "\n", " # Add small noise so each episode is unique\n", " for k in self.state_data:\n", " self.state_data[k] = float(np.clip(\n", " self.state_data[k] + np.random.normal(0, 0.02), 0.0, 1.0\n", " ))\n", "\n", " self._prev_state = dict(self.state_data)\n", " return self._build_obs()\n", "\n", " def _build_obs(self) -> dict:\n", " \"\"\"10-dim observation: current state + delta from previous step.\"\"\"\n", " obs = dict(self.state_data)\n", " obs[\"_task\"] = self.task_id\n", " obs[\"_step\"] = self.step_count\n", " if self._prev_state:\n", " for k in [\"inflation\",\"employment\",\"health\",\"satisfaction\",\"crime\"]:\n", " obs[f\"d_{k}\"] = self.state_data[k] - self._prev_state[k]\n", " else:\n", " for k in [\"inflation\",\"employment\",\"health\",\"satisfaction\",\"crime\"]:\n", " obs[f\"d_{k}\"] = 0.0\n", " return obs\n", "\n", " def _apply_shocks(self):\n", " \"\"\"Stochastic external shock events.\"\"\"\n", " for shock in self.SHOCK_EVENTS:\n", " if np.random.random() < shock[\"prob\"]:\n", " self.shock_log.append({\"step\": self.step_count, \"event\": shock[\"name\"]})\n", " for k, delta in shock[\"effect\"].items():\n", " if k in self.state_data:\n", " self.state_data[k] = float(np.clip(self.state_data[k] + delta, 0.0, 1.0))\n", " console.log(f\"[yellow]⚡ Shock event: {shock['name']} at step {self.step_count}\")\n", "\n", " def step(self, action: dict) -> Tuple[dict, float, bool, dict]:\n", " \"\"\"\n", " action keys: tax, jobs, healthcare, education, infrastructure\n", " Each in [0, 1] — represents budget allocation intensity.\n", " \"\"\"\n", " self._prev_state = dict(self.state_data)\n", "\n", " # Policy effects (with diminishing returns via sqrt)\n", " tax = action.get(\"tax\", 0.5)\n", " jobs = action.get(\"jobs\", 0.5)\n", " healthcare = action.get(\"healthcare\", 0.5)\n", " education = action.get(\"education\", 0.5)\n", " infra = action.get(\"infrastructure\",0.5)\n", "\n", " self.state_data[\"inflation\"] = np.clip(\n", " self.state_data[\"inflation\"] - tax * 0.08 + jobs * 0.02, 0.0, 1.0)\n", " self.state_data[\"employment\"] = np.clip(\n", " self.state_data[\"employment\"] + jobs * 0.06 + infra * 0.02, 0.0, 1.0)\n", " self.state_data[\"health\"] = np.clip(\n", " self.state_data[\"health\"] + healthcare * 0.07 + education * 0.02, 0.0, 1.0)\n", " self.state_data[\"satisfaction\"] = np.clip(\n", " self.state_data[\"satisfaction\"] + education * 0.05 + infra * 0.03\n", " - tax * 0.03, 0.0, 1.0)\n", " self.state_data[\"crime\"] = np.clip(\n", " self.state_data[\"crime\"] + education * 0.05 + jobs * 0.03\n", " - infra * 0.01, 0.0, 1.0)\n", "\n", " # Gaussian noise\n", " for k in self.state_data:\n", " self.state_data[k] = float(np.clip(\n", " self.state_data[k] + np.random.normal(0, 0.008), 0.0, 1.0))\n", "\n", " self._apply_shocks()\n", " self.step_count += 1\n", "\n", " reward = self._compute_reward()\n", " done = self.step_count >= 50\n", " info = {\"shocks\": self.shock_log, \"step\": self.step_count}\n", " return self._build_obs(), float(reward), done, info\n", "\n", " def _compute_reward(self) -> float:\n", " s = self.state_data\n", " w = self.weights\n", " return (\n", " w[\"inflation_weight\"] * s[\"inflation\"] +\n", " w[\"employment_weight\"] * s[\"employment\"] +\n", " w[\"health_weight\"] * s[\"health\"] +\n", " w[\"satisfaction_weight\"] * s[\"satisfaction\"] +\n", " w[\"crime_weight\"] * s[\"crime\"]\n", " )\n", "\n", " def state_report(self) -> dict:\n", " return {k: round(v, 4) for k, v in self.state_data.items()}\n", "\n", "\n", "# Smoke test\n", "env_adv = AdvancedCivicAIEnv(fetcher, default_country=\"USA\")\n", "obs = env_adv.reset(\"stabilize_economy\", \"USA\")\n", "console.rule(\"[bold green]Advanced Environment Ready\")\n", "console.print(f\"Initial state (USA, real data): {env_adv.state_report()}\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "3i4Olantl2EW" }, "outputs": [], "source": [ "def build_prompt(obs: dict) -> str:\n", " task_desc = {\n", " \"stabilize_economy\" : \"Your priority is economic stability: control inflation and protect employment.\",\n", " \"improve_health\" : \"Your priority is public health: maximize health outcomes and life expectancy.\",\n", " \"reduce_crime\" : \"Your priority is public safety: reduce crime through investment and employment.\",\n", " \"maximize_wellbeing\" : \"Your priority is overall citizen wellbeing across all dimensions.\",\n", " }.get(obs.get(\"_task\",\"\"), \"Optimize all civic outcomes.\")\n", "\n", " return (\n", " f\"You are a senior policy advisor.\\n{task_desc}\\n\\n\"\n", " f\"CURRENT STATE (step {obs.get('_step',0)}):\\n\"\n", " f\" Inflation score : {obs.get('inflation',0.5):.3f} (Δ {obs.get('d_inflation',0):+.3f})\\n\"\n", " f\" Employment score : {obs.get('employment',0.5):.3f} (Δ {obs.get('d_employment',0):+.3f})\\n\"\n", " f\" Health score : {obs.get('health',0.5):.3f} (Δ {obs.get('d_health',0):+.3f})\\n\"\n", " f\" Satisfaction score: {obs.get('satisfaction',0.5):.3f} (Δ {obs.get('d_satisfaction',0):+.3f})\\n\"\n", " f\" Crime score : {obs.get('crime',0.5):.3f} (Δ {obs.get('d_crime',0):+.3f})\\n\\n\"\n", " \"OUTPUT FORMAT (all values 0.0–1.0, no other text):\\n\"\n", " \"tax: 0.X, jobs: 0.X, healthcare: 0.X, education: 0.X, infrastructure: 0.X\"\n", " )\n", "\n", "\n", "def parse_action(text: str) -> dict:\n", " \"\"\"5-dimensional action parser with robust regex.\"\"\"\n", " keys = [\"tax\", \"jobs\", \"healthcare\", \"education\", \"infrastructure\"]\n", "\n", " def extract(key: str) -> float:\n", " m = re.search(rf\"{key}\\s*:\\s*(\\d*\\.?\\d+)\", text)\n", " if m:\n", " try:\n", " return float(np.clip(float(m.group(1)), 0.0, 1.0))\n", " except ValueError:\n", " pass\n", " return 0.5\n", "\n", " return {k: extract(k) for k in keys}" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 585, "referenced_widgets": [ "87261748ca7d4941a4239b76c10fd8f9", "feca60e38be4482bb2a967e7226e1994", "9eeeff30b9944af2bbae91e3e68a042b", "6d28bfa916954318963806caaae2da5f", "bef2b1f1f0f0410ba5d1ff74a31f272a", "343cacab67b0490cb33d41cf0e9fac58", "cd67a1ff8b1441aba237c1d4d4ea6ee3", "992fdf808c82423d9090b2aaafe10aed", "70ce11abac5f4e11a1ff84dd5ede2fff", "8bfac1c2c09642b284bac6cc598a95cf", "ab8dd52e79134a50b39893a2da744d57", "e2df56f4da4345ecaad24e0e33128dd5", "4e2f15ea286047cca301ad89c077d7ed", "a20bc44d88f84906b2413b9057ec2f6c", "b36631dd86e245daaaaf70188a64e9aa", "952181added44a1794fe7011f1af0816", "f775e249d9c84757aec02b8636738cae", "c6f1bc21756b4fa59a26a78f75fe09f3", "26a0842343b64124af9603844c4333ed", "685fe3a6d0a2465dad35c68d2b99c249", "41e3b142a4f04dd3a2584d5c445d0e00", "251d1b70d4234174a02b5b1ad3134cf9", "d68aea2f8b0044ebb2524fe8ac6ec1fd", "f207f79ce9444a8eaddf88fe21116aaa", "a59d7ac091e049559ca0f88a46dc6e58", "5cea20a59959417f9bbf5c39a9b164b0", "d6e0edad338e4d83bc61a3a83cca20da", "bad878c955db49398e731b6473be0842", "abb338ad3f6346ca812c1fad388f2934", "3934fc86b5ee46edba6b0fac99d1af85", "ba60d1545da64fdc933f56722550def0", "6f13dd2d836746d0ba7673eb5fbd48a5", "93544687cf294c6a92bd1ef0f03a99ae", "83702cefabd54c4386825ce0ab727df7", "9e507b28664d471bae14f6776c1c5b13", "5f2f567bddf541e8bfa37f2bd9035be4", "a45f3f86598c45c9bcfeac4a0887a706", "30551bf982cf4da4904bc0705c316b67", "fec2b63e94e6463480e2b228b8ff9a0b", "2b6ee0bde2114e528e6d13d24e599e75", "b184d765f69544bf9a23de55bf49ebf9", "a7e9986b10de4d6fa6f9db861ef9358c", "b0d3193d8ff4483f81ccc3bdb3fdd7b7", "5cbc45a0bc104745bbceef8b08a25096", "83e967db50144bbf8feda1660679e154", "1784d432f2624bcfa5dd18b5334841b6", "56aa5c6733f64871991da63b9935fe7c", "88d31aba4a3247b792c463db856904a0", "05e95272692842b29fec8e13f1590bd2", "18f38e3774ff4e54a77033e3edcc1602", "1f49fa468cf343f9ac7385c0c0d1f2cc", "b65f5c5428fb4d63b9aab0f7b7eb5fbc", "f40ea52496054b93bc870ad63ab74620", "38e25d69edbc44d8bbedc4e8e7f62e39", "a6e6bf298f3d4112b714b457af607f2b", "0f937b3301c94ecd8f44189ea641c222", "cfc54026704545d498b3b2d9c0fe912e", "4d9a59f651a04239adde42290ef06c27", "1fb43f8f8fc246768d119411887cd15a", "f969d53f13b0490781bec68dab2d3b13", "117c1bccd8fe4edc9810151d376648ec", "8e7c4059aece4a01b37dbb1800d1cedd", "5d97e8b1de6b460d85761a8278c1a1cf", "2cb61682ebca4c7e91d3990187e8fc72", "46ef40073958467ba658ce4b3e81a001", "322b91e9115b41cf9d45f9b9934b8ac0", "953b658c117d42cd89adfa93e1deadf8", "f9dbada0887f4821a9c417ecbfdacc32", "002c5b875ba74a659dc47cb255428607", "5fe527612db54e99be88c941ff881349", "17400ab03b4d446fbf7a3dfe782ce81c", "620648632beb481992e028d298741c1d", "d8c68d58a5644e908aaf15954041deab", "2b59d571e1434bb4910c49c76502ac98", "7e5258c924a04a48ad49dfaec78e6acd", "b946b8a284b54356be0f851a9fe106d4", "a1bdee8bd9ae42a790c38f17155d22b8", "02ca91e4250f4cf4b6594757905f241a", "d1b1899bbb1549e8963e360e8e0fe181", "62f0caaed66f48d5b828e1264534b0ca", "d5407a6fe9af4cd9a563fa28d55911db", "0c711677b41547d38486368847f71087", "f5b03dbb98fd47569f4836ed46face4b", "2daeb61435a14098b0b7b19d89c364a3", "556f537c832549b487c7fe839df06a0b", "1265b9cb4cbe428c94c8139a28caff13", "c8ccd98c81f1465ca4ddc82cc54ffc4c", "2e3c5a92074e43f2be3ac3e5a7eff887" ] }, "id": "mKGs0I_Cl68D", "outputId": "cb3aba1d-a83e-4f4b-87b9-8d3d5c251e6f" }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.\n", "WARNING:huggingface_hub.utils._http:Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "87261748ca7d4941a4239b76c10fd8f9", "version_major": 2, "version_minor": 0 }, "text/plain": [ "config.json: 0%| | 0.00/665 [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "e2df56f4da4345ecaad24e0e33128dd5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "tokenizer_config.json: 0%| | 0.00/26.0 [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d68aea2f8b0044ebb2524fe8ac6ec1fd", "version_major": 2, "version_minor": 0 }, "text/plain": [ "vocab.json: 0.00B [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "83702cefabd54c4386825ce0ab727df7", "version_major": 2, "version_minor": 0 }, "text/plain": [ "merges.txt: 0.00B [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "83e967db50144bbf8feda1660679e154", "version_major": 2, "version_minor": 0 }, "text/plain": [ "tokenizer.json: 0.00B [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "`torch_dtype` is deprecated! Use `dtype` instead!\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "0f937b3301c94ecd8f44189ea641c222", "version_major": 2, "version_minor": 0 }, "text/plain": [ "model.safetensors: 0%| | 0.00/548M [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "953b658c117d42cd89adfa93e1deadf8", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Loading weights: 0%| | 0/148 [00:00, ?it/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "GPT2LMHeadModel LOAD REPORT from: gpt2\n", "Key | Status | | \n", "---------------------+------------+--+-\n", "h.{0...11}.attn.bias | UNEXPECTED | | \n", "\n", "Notes:\n", "- UNEXPECTED\t:can be ignored when loading from different task/architecture; not ok if you expect identical arch.\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "02ca91e4250f4cf4b6594757905f241a", "version_major": 2, "version_minor": 0 }, "text/plain": [ "generation_config.json: 0%| | 0.00/124 [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING:torchao.kernel.intmm:Warning: Detected no triton, on systems without Triton certain kernels will not work\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "trainable params: 294,912 || all params: 124,734,720 || trainable%: 0.2364\n" ] }, { "data": { "text/html": [ "
─────────────────────────────────────────────────── Model Ready ───────────────────────────────────────────────────\n", "\n" ], "text/plain": [ "\u001b[92m─────────────────────────────────────────────────── \u001b[0m\u001b[1;32mModel Ready\u001b[0m\u001b[92m ───────────────────────────────────────────────────\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[02:22:51] Model : gpt2 + LoRA (r=8) 3714833569.py:29\n", "\n" ], "text/plain": [ "\u001b[2;36m[02:22:51]\u001b[0m\u001b[2;36m \u001b[0m\u001b[36mModel : gpt2 + LoRA \u001b[0m\u001b[1;36m(\u001b[0m\u001b[36mr\u001b[0m\u001b[36m=\u001b[0m\u001b[1;36m8\u001b[0m\u001b[1;36m)\u001b[0m \u001b]8;id=980795;file:///tmp/ipykernel_2561/3714833569.py\u001b\\\u001b[2m3714833569.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=235903;file:///tmp/ipykernel_2561/3714833569.py#29\u001b\\\u001b[2m29\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Parameters : 124.7M total 3714833569.py:30\n", "\n" ], "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[36mParameters : \u001b[0m\u001b[1;36m124.\u001b[0m\u001b[36m7M total\u001b[0m \u001b]8;id=137043;file:///tmp/ipykernel_2561/3714833569.py\u001b\\\u001b[2m3714833569.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=114016;file:///tmp/ipykernel_2561/3714833569.py#30\u001b\\\u001b[2m30\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from transformers import AutoTokenizer, AutoModelForCausalLM\n", "from peft import LoraConfig, get_peft_model, TaskType\n", "\n", "MODEL_NAME = \"gpt2\" # swap to \"gpt2-medium\" or \"distilgpt2\" as needed\n", "\n", "tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)\n", "tokenizer.pad_token = tokenizer.eos_token\n", "tokenizer.padding_side = \"left\"\n", "\n", "base_model = AutoModelForCausalLM.from_pretrained(\n", " MODEL_NAME,\n", " torch_dtype = torch.bfloat16 if USE_BF16 else torch.float32,\n", ")\n", "\n", "# ── Attach LoRA adapters (reduces trainable params by ~90%) ──────────────────\n", "lora_cfg = LoraConfig(\n", " task_type = TaskType.CAUSAL_LM,\n", " r = 8, # rank\n", " lora_alpha = 32,\n", " target_modules = [\"c_attn\"], # GPT-2 attention projection\n", " lora_dropout = 0.05,\n", " bias = \"none\",\n", ")\n", "model = get_peft_model(base_model, lora_cfg)\n", "model.print_trainable_parameters()\n", "model = model.to(DEVICE)\n", "\n", "console.rule(\"[bold green]Model Ready\")\n", "console.log(f\"[cyan]Model : {MODEL_NAME} + LoRA (r=8)\")\n", "console.log(f\"[cyan]Parameters : {sum(p.numel() for p in model.parameters())/1e6:.1f}M total\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 219 }, "id": "vhKuP2-zmNmm", "outputId": "4bf042e7-24ef-466d-a0f8-49152921fee6" }, "outputs": [ { "data": { "text/html": [ "
[02:23:14] ✓ Dataset: 300 prompts across 4 tasks × 6 countries 401992419.py:20\n", "\n" ], "text/plain": [ "\u001b[2;36m[02:23:14]\u001b[0m\u001b[2;36m \u001b[0m\u001b[32m✓ Dataset: \u001b[0m\u001b[1;32m300\u001b[0m\u001b[32m prompts across \u001b[0m\u001b[1;32m4\u001b[0m\u001b[32m tasks × \u001b[0m\u001b[1;32m6\u001b[0m\u001b[32m countries\u001b[0m \u001b]8;id=296563;file:///tmp/ipykernel_2561/401992419.py\u001b\\\u001b[2m401992419.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=472526;file:///tmp/ipykernel_2561/401992419.py#20\u001b\\\u001b[2m20\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Sample: 401992419.py:22\n", " You are a senior policy advisor. \n", " Your priority is economic stability: control inflation and protect employment. \n", " \n", " CURRENT STATE (step 0): \n", " Inflation score : 0.777 (Δ +0.000) \n", " Employment score : 0.836 (Δ +0.000) \n", " Health score : 0.870 (Δ +0.000) \n", " Satisfaction score: 0.529 (Δ +0.000) \n", " C... \n", "\n" ], "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m Sample: \u001b]8;id=110834;file:///tmp/ipykernel_2561/401992419.py\u001b\\\u001b[2m401992419.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=230086;file:///tmp/ipykernel_2561/401992419.py#22\u001b\\\u001b[2m22\u001b[0m\u001b]8;;\u001b\\\n", "\u001b[2;36m \u001b[0mYou are a senior policy advisor. \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0mYour priority is economic stability: control inflation and protect employment. \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0m \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0mCURRENT STATE \u001b[1m(\u001b[0mstep \u001b[1;36m0\u001b[0m\u001b[1m)\u001b[0m: \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0m Inflation score : \u001b[1;36m0.777\u001b[0m \u001b[1m(\u001b[0mΔ +\u001b[1;36m0.000\u001b[0m\u001b[1m)\u001b[0m \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0m Employment score : \u001b[1;36m0.836\u001b[0m \u001b[1m(\u001b[0mΔ +\u001b[1;36m0.000\u001b[0m\u001b[1m)\u001b[0m \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0m Health score : \u001b[1;36m0.870\u001b[0m \u001b[1m(\u001b[0mΔ +\u001b[1;36m0.000\u001b[0m\u001b[1m)\u001b[0m \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0m Satisfaction score: \u001b[1;36m0.529\u001b[0m \u001b[1m(\u001b[0mΔ +\u001b[1;36m0.000\u001b[0m\u001b[1m)\u001b[0m \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0m C\u001b[33m...\u001b[0m \u001b[2m \u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from datasets import Dataset\n", "\n", "NUM_SAMPLES = 300\n", "records = []\n", "env_tmp = AdvancedCivicAIEnv(fetcher)\n", "task_list = list(AdvancedCivicAIEnv.TASKS.keys())\n", "country_list= list(RealTimeDataFetcher.COUNTRIES.keys())\n", "\n", "for i in range(NUM_SAMPLES):\n", " task = task_list[i % len(task_list)]\n", " country = country_list[i % len(country_list)]\n", " obs = env_tmp.reset(task, country)\n", " records.append({\n", " \"prompt\" : build_prompt(obs),\n", " \"task\" : task,\n", " \"country\" : country,\n", " })\n", "\n", "train_dataset = Dataset.from_list(records)\n", "console.log(f\"[green]✓ Dataset: {len(train_dataset)} prompts across \"\n", " f\"{len(task_list)} tasks × {len(country_list)} countries\")\n", "console.log(f\" Sample:\\n{train_dataset[0]['prompt'][:300]}...\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "3luuRr42mTFr" }, "outputs": [], "source": [ "def civic_reward_advanced(prompts, completions, task=None, country=None, **kwargs) -> List[float]:\n", " \"\"\"\n", " Multi-objective GRPO reward function.\n", " Scores: environment reward + format compliance + consistency bonus.\n", " \"\"\"\n", " rewards = []\n", " env_r = AdvancedCivicAIEnv(fetcher)\n", " task_list_ = task if isinstance(task, list) else [task] * len(prompts)\n", " country_ = country if isinstance(country,list) else [country]* len(prompts)\n", "\n", " for i, (prompt, completion) in enumerate(zip(prompts, completions)):\n", " # Extract text\n", " if isinstance(completion, list) and len(completion) > 0:\n", " text = completion[0].get(\"content\", \"\")\n", " else:\n", " text = str(completion)\n", "\n", " action = parse_action(text)\n", "\n", " # Environment reward\n", " t = (task_list_[i] if task_list_[i] else \"maximize_wellbeing\")\n", " c = (country_[i] if country_[i] else \"USA\")\n", " env_r.reset(t, c)\n", " _, env_rew, _, _ = env_r.step(action)\n", "\n", " # Format reward: all 5 keys present\n", " keys_found = sum(\n", " 1 for k in [\"tax\",\"jobs\",\"healthcare\",\"education\",\"infrastructure\"]\n", " if re.search(rf\"{k}\\s*:\\s*\\d\", text)\n", " )\n", " fmt_bonus = (keys_found / 5.0) * 0.15 # up to +0.15\n", "\n", " # Diversity bonus: penalise all-same values (lazy policy)\n", " vals = list(action.values())\n", " div_bonus = float(np.std(vals)) * 0.1 # up to ~+0.05\n", "\n", " total = float(env_rew) + fmt_bonus + div_bonus\n", " rewards.append(round(total, 5))\n", "\n", " return rewards" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 93 }, "id": "R0PzbuWamgEd", "outputId": "2756301b-b345-4d37-c532-6a014d3c069c" }, "outputs": [ { "data": { "text/html": [ "
[02:24:46] Skipped unsupported GRPOConfig args: {'max_prompt_length'} 1096250958.py:30\n", "\n" ], "text/plain": [ "\u001b[2;36m[02:24:46]\u001b[0m\u001b[2;36m \u001b[0m\u001b[33mSkipped unsupported GRPOConfig args: \u001b[0m\u001b[1;33m{\u001b[0m\u001b[33m'max_prompt_length'\u001b[0m\u001b[1;33m}\u001b[0m \u001b]8;id=505951;file:///tmp/ipykernel_2561/1096250958.py\u001b\\\u001b[2m1096250958.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=648775;file:///tmp/ipykernel_2561/1096250958.py#30\u001b\\\u001b[2m30\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "warmup_ratio is deprecated and will be removed in v5.2. Use `warmup_steps` instead.\n" ] }, { "data": { "text/html": [ "
✓ GRPOTrainer initialised with LoRA + multi-objective reward 1096250958.py:41\n", "\n" ], "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[32m✓ GRPOTrainer initialised with LoRA + multi-objective reward\u001b[0m \u001b]8;id=256787;file:///tmp/ipykernel_2561/1096250958.py\u001b\\\u001b[2m1096250958.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=234053;file:///tmp/ipykernel_2561/1096250958.py#41\u001b\\\u001b[2m41\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from trl import GRPOConfig, GRPOTrainer\n", "\n", "valid_params = set(inspect.signature(GRPOConfig.__init__).parameters)\n", "\n", "all_kwargs = {\n", " \"output_dir\" : \"checkpoints/civicai-grpo\",\n", " \"num_train_epochs\" : 3,\n", " \"per_device_train_batch_size\" : 2,\n", " \"num_generations\" : 2,\n", " \"max_prompt_length\" : 300,\n", " \"max_completion_length\" : 80,\n", " \"learning_rate\" : 5e-6,\n", " \"logging_steps\" : 5,\n", " \"save_strategy\" : \"epoch\",\n", " \"save_total_limit\" : 2,\n", " \"report_to\" : \"none\",\n", " \"remove_unused_columns\" : False,\n", " \"bf16\" : USE_BF16,\n", " \"fp16\" : USE_FP16,\n", " \"gradient_accumulation_steps\" : 4,\n", " \"max_grad_norm\" : 0.3,\n", " \"warmup_ratio\" : 0.05,\n", " \"lr_scheduler_type\" : \"cosine\",\n", " \"dataloader_num_workers\" : 0,\n", "}\n", "\n", "safe_kwargs = {k: v for k, v in all_kwargs.items() if k in valid_params}\n", "skipped = set(all_kwargs) - set(safe_kwargs)\n", "if skipped:\n", " console.log(f\"[yellow]Skipped unsupported GRPOConfig args: {skipped}\")\n", "\n", "grpo_config = GRPOConfig(**safe_kwargs)\n", "\n", "trainer = GRPOTrainer(\n", " model = model,\n", " args = grpo_config,\n", " reward_funcs = civic_reward_advanced,\n", " train_dataset = train_dataset,\n", " processing_class = tokenizer,\n", ")\n", "console.log(\"[green]✓ GRPOTrainer initialised with LoRA + multi-objective reward\")" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000, "referenced_widgets": [ "944c40ec95e2465b80a72fe81442e073", "199c4f4f31ec433da34dee3590ad38b6", "1d6a657594c449bdb5ca00ebf53b81c2", "2e3785dcd8d94fc79e6ecd58ec844004", "e538d2d016904a349c4a6f02ac2f8431", "b1c8740b107b4efba749a80fe16dea9a" ] }, "id": "dkC9BOmlmraC", "outputId": "7487114d-8145-475c-9948-90c7d1c76ea9" }, "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "\u001b[32m⠴\u001b[0m \u001b[36mFetching live data for Germany\u001b[0m\n" ], "text/html": [ "
⠴ Fetching live data for Germany\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [], "text/html": [ "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "
| Step | \n", "Training Loss | \n", "
|---|---|
| 5 | \n", "-0.021373 | \n", "
| 10 | \n", "-0.011424 | \n", "
| 15 | \n", "-0.006821 | \n", "
| 20 | \n", "-0.028652 | \n", "
| 25 | \n", "0.008003 | \n", "
| 30 | \n", "-0.018843 | \n", "
| 35 | \n", "-0.008445 | \n", "
| 40 | \n", "0.006863 | \n", "
| 45 | \n", "0.051092 | \n", "
| 50 | \n", "-0.034912 | \n", "
| 55 | \n", "0.009598 | \n", "
| 60 | \n", "0.019081 | \n", "
| 65 | \n", "-0.028053 | \n", "
| 70 | \n", "0.043792 | \n", "
| 75 | \n", "0.006664 | \n", "
| 80 | \n", "0.010932 | \n", "
| 85 | \n", "0.006224 | \n", "
| 90 | \n", "0.031435 | \n", "
| 95 | \n", "-0.016205 | \n", "
| 100 | \n", "-0.033808 | \n", "
| 105 | \n", "-0.012204 | \n", "
| 110 | \n", "0.015441 | \n", "
| 115 | \n", "-0.002538 | \n", "
| 120 | \n", "0.001867 | \n", "
| 125 | \n", "0.054835 | \n", "
| 130 | \n", "0.006275 | \n", "
| 135 | \n", "-0.004998 | \n", "
| 140 | \n", "-0.006802 | \n", "
| 145 | \n", "-0.012463 | \n", "
| 150 | \n", "-0.031181 | \n", "
| 155 | \n", "-0.011517 | \n", "
| 160 | \n", "0.002979 | \n", "
| 165 | \n", "-0.007794 | \n", "
| 170 | \n", "0.006225 | \n", "
| 175 | \n", "0.018407 | \n", "
| 180 | \n", "0.010794 | \n", "
| 185 | \n", "-0.001346 | \n", "
| 190 | \n", "-0.020392 | \n", "
| 195 | \n", "-0.004263 | \n", "
| 200 | \n", "0.026999 | \n", "
| 205 | \n", "-0.008383 | \n", "
| 210 | \n", "0.027005 | \n", "
| 215 | \n", "-0.002897 | \n", "
| 220 | \n", "0.016621 | \n", "
| 225 | \n", "0.020560 | \n", "
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m[06:09:16]\u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: recession at step \u001b[0m\u001b[1;33m0\u001b[0m \u001b]8;id=695612;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=889208;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
[06:09:16] ⚡ Shock event: recession at step 0 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m[06:10:18]\u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: recession at step \u001b[0m\u001b[1;33m0\u001b[0m \u001b]8;id=531756;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=324308;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
[06:10:18] ⚡ Shock event: recession at step 0 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m[06:11:20]\u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: crime_spike at step \u001b[0m\u001b[1;33m0\u001b[0m \u001b]8;id=731076;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=310016;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
[06:11:20] ⚡ Shock event: crime_spike at step 0 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m[06:15:39]\u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: recession at step \u001b[0m\u001b[1;33m0\u001b[0m \u001b]8;id=697229;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=986042;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
[06:15:39] ⚡ Shock event: recession at step 0 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m[06:16:46]\u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: recession at step \u001b[0m\u001b[1;33m0\u001b[0m \u001b]8;id=182480;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=645414;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
[06:16:46] ⚡ Shock event: recession at step 0 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m[06:24:34]\u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: crime_spike at step \u001b[0m\u001b[1;33m0\u001b[0m \u001b]8;id=874224;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=425;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
[06:24:34] ⚡ Shock event: crime_spike at step 0 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m[06:25:38]\u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: boom at step \u001b[0m\u001b[1;33m0\u001b[0m \u001b]8;id=823927;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=608158;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
[06:25:38] ⚡ Shock event: boom at step 0 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[92m────────────────────────────────────────── \u001b[0m\u001b[1;32mTraining Complete — \u001b[0m\u001b[1;32m244.1\u001b[0m\u001b[1;32m min\u001b[0m\u001b[92m ──────────────────────────────────────────\u001b[0m\n" ], "text/html": [ "
────────────────────────────────────────── Training Complete — 244.1 min ──────────────────────────────────────────\n", "\n" ] }, "metadata": {} } ], "source": [ "console.rule(\"[bold cyan]Starting GRPO Training\")\n", "start_time = time.time()\n", "trainer.train()\n", "elapsed = time.time() - start_time\n", "console.rule(f\"[bold green]Training Complete — {elapsed/60:.1f} min\")" ] }, { "cell_type": "code", "source": [ "logs = trainer.state.log_history\n", "df_logs = pd.DataFrame(logs).dropna(subset=[\"loss\"] if \"loss\" in pd.DataFrame(logs).columns else [])\n", "\n", "reward_entries = [e for e in logs if \"reward\" in e]\n", "rewards_logged = [e[\"reward\"] for e in reward_entries]\n", "steps_logged = [e.get(\"step\", i) for i, e in enumerate(reward_entries)]\n", "\n", "fig = make_subplots(rows=1, cols=2,\n", " subplot_titles=(\"Reward Curve\", \"Reward Distribution\"))\n", "\n", "# Reward over steps\n", "fig.add_trace(go.Scatter(\n", " x=steps_logged, y=rewards_logged,\n", " mode=\"lines\", name=\"Reward\", line=dict(color=\"#00d4ff\", width=2)\n", "), row=1, col=1)\n", "\n", "# Smoothed\n", "if len(rewards_logged) > 5:\n", " smooth = np.convolve(rewards_logged, np.ones(5)/5, mode=\"valid\")\n", " fig.add_trace(go.Scatter(\n", " x=steps_logged[4:], y=smooth,\n", " mode=\"lines\", name=\"Smoothed\",\n", " line=dict(color=\"#ff6b6b\", width=2, dash=\"dash\")\n", " ), row=1, col=1)\n", "\n", "# Histogram\n", "fig.add_trace(go.Histogram(\n", " x=rewards_logged, nbinsx=20,\n", " marker_color=\"#00d4ff\", opacity=0.75, name=\"Distribution\"\n", "), row=1, col=2)\n", "\n", "fig.update_layout(\n", " title=\"CivicAI GRPO Training Metrics\",\n", " template=\"plotly_dark\", height=420,\n", " paper_bgcolor=\"#0d1117\", font=dict(color=\"#e6edf3\"),\n", ")\n", "fig.show()\n", "fig.write_html(\"assets/training_metrics.html\")\n", "\n", "if rewards_logged:\n", " console.print(f\"[cyan]Start reward : {rewards_logged[0]:.4f}\")\n", " console.print(f\"[cyan]Final reward : {rewards_logged[-1]:.4f}\")\n", " console.print(f\"[green]Improvement : {rewards_logged[-1]-rewards_logged[0]:+.4f}\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 485 }, "id": "gzOFp6HNHesh", "outputId": "f226cfeb-00f2-4c09-f3a6-0a767b9dda64" }, "execution_count": 13, "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "
Start reward : 0.7967\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[36mFinal reward : \u001b[0m\u001b[1;36m0.7624\u001b[0m\n" ], "text/html": [ "
Final reward : 0.7624\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[32mImprovement : \u001b[0m\u001b[1;32m-0.0343\u001b[0m\n" ], "text/html": [ "
Improvement : -0.0343\n", "\n" ] }, "metadata": {} } ] }, { "cell_type": "code", "source": [ "def evaluate_trained_policy(\n", " model, tokenizer, fetcher,\n", " countries: List[str] = None,\n", " tasks: List[str] = None,\n", " episodes: int = 5,\n", ") -> pd.DataFrame:\n", " \"\"\"Evaluate trained policy on all countries × all tasks.\"\"\"\n", " countries = countries or list(RealTimeDataFetcher.COUNTRIES.keys())\n", " tasks = tasks or list(AdvancedCivicAIEnv.TASKS.keys())\n", " model.eval()\n", " results = []\n", "\n", " for country in countries:\n", " for task in tasks:\n", " ep_rewards = []\n", " env_eval = AdvancedCivicAIEnv(fetcher, default_country=country)\n", "\n", " for _ in range(episodes):\n", " obs = env_eval.reset(task, country)\n", " ep_reward = 0.0\n", " for _ in range(20):\n", " prompt = build_prompt(obs)\n", " inputs = tokenizer(prompt, return_tensors=\"pt\",\n", " truncation=True, max_length=300).to(DEVICE)\n", " with torch.no_grad():\n", " out = model.generate(\n", " **inputs, max_new_tokens=60,\n", " do_sample=False,\n", " pad_token_id=tokenizer.eos_token_id,\n", " )\n", " gen_tokens = out[0][inputs[\"input_ids\"].shape[1]:]\n", " text = tokenizer.decode(gen_tokens, skip_special_tokens=True)\n", " action = parse_action(text)\n", " obs, r, done, _ = env_eval.step(action)\n", " ep_reward += r\n", " if done: break\n", " ep_rewards.append(ep_reward / 20)\n", "\n", " results.append({\n", " \"country\" : RealTimeDataFetcher.COUNTRIES[country][\"name\"],\n", " \"task\" : task,\n", " \"mean_r\" : round(float(np.mean(ep_rewards)), 4),\n", " \"std_r\" : round(float(np.std(ep_rewards)), 4),\n", " \"max_r\" : round(float(np.max(ep_rewards)), 4),\n", " })\n", " console.log(f\"[dim]{country} / {task} → {results[-1]['mean_r']:.4f}\")\n", "\n", " return pd.DataFrame(results)\n", "\n", "\n", "def baseline_score(fetcher, episodes=5):\n", " \"\"\"Fixed 0.5 policy baseline.\"\"\"\n", " env_b, total = AdvancedCivicAIEnv(fetcher, \"USA\"), []\n", " for _ in range(episodes):\n", " obs = env_b.reset(\"maximize_wellbeing\", \"USA\")\n", " r = 0.0\n", " for _ in range(20):\n", " obs, rew, done, _ = env_b.step(\n", " {k: 0.5 for k in [\"tax\",\"jobs\",\"healthcare\",\"education\",\"infrastructure\"]}\n", " )\n", " r += rew\n", " total.append(r / 20)\n", " return float(np.mean(total))\n", "\n", "\n", "console.rule(\"[bold cyan]Evaluating Policy Across Countries & Tasks\")\n", "df_eval = evaluate_trained_policy(model, tokenizer, fetcher, episodes=3)\n", "baseline = baseline_score(fetcher)\n", "\n", "console.print(df_eval.to_string(index=False))\n", "console.print(f\"\\n[bold]Baseline (fixed 0.5) : {baseline:.4f}\")\n", "console.print(f\"[bold green]Best trained score : {df_eval['mean_r'].max():.4f}\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 670 }, "id": "k59vpTRYHiqS", "outputId": "07631bd5-5931-4d48-dcd0-3442b3e50782" }, "execution_count": 14, "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "\u001b[32m⠦\u001b[0m \u001b[36mFetching live data for United States\u001b[0m\n" ], "text/html": [ "
⠦ Fetching live data for United States\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [], "text/html": [ "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m[08:52:35]\u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: recession at step \u001b[0m\u001b[1;33m0\u001b[0m \u001b]8;id=628492;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=532929;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
[08:52:35] ⚡ Shock event: recession at step 0 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: recession at step \u001b[0m\u001b[1;33m13\u001b[0m \u001b]8;id=73201;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=289666;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
⚡ Shock event: recession at step 13 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: recession at step \u001b[0m\u001b[1;33m14\u001b[0m \u001b]8;id=356385;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=979630;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
⚡ Shock event: recession at step 14 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: boom at step \u001b[0m\u001b[1;33m18\u001b[0m \u001b]8;id=2689;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=296578;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
⚡ Shock event: boom at step 18 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: crime_spike at step \u001b[0m\u001b[1;33m15\u001b[0m \u001b]8;id=608093;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=691998;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
⚡ Shock event: crime_spike at step 15 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: recession at step \u001b[0m\u001b[1;33m3\u001b[0m \u001b]8;id=564742;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=507868;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
⚡ Shock event: recession at step 3 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: boom at step \u001b[0m\u001b[1;33m6\u001b[0m \u001b]8;id=569827;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=395533;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
⚡ Shock event: boom at step 6 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: boom at step \u001b[0m\u001b[1;33m12\u001b[0m \u001b]8;id=197816;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=731380;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
⚡ Shock event: boom at step 12 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: boom at step \u001b[0m\u001b[1;33m10\u001b[0m \u001b]8;id=897594;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=813217;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
⚡ Shock event: boom at step 10 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: recession at step \u001b[0m\u001b[1;33m11\u001b[0m \u001b]8;id=495951;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=739485;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
⚡ Shock event: recession at step 11 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[33m⚡ Shock event: crime_spike at step \u001b[0m\u001b[1;33m17\u001b[0m \u001b]8;id=695928;file:///tmp/ipykernel_2561/4216972446.py\u001b\\\u001b[2m4216972446.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=830884;file:///tmp/ipykernel_2561/4216972446.py#75\u001b\\\u001b[2m75\u001b[0m\u001b]8;;\u001b\\\n" ], "text/html": [ "
⚡ Shock event: crime_spike at step 17 4216972446.py:75\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ " country task mean_r std_r max_r\n", " United States stabilize_economy \u001b[1;36m0.7832\u001b[0m \u001b[1;36m0.0244\u001b[0m \u001b[1;36m0.8176\u001b[0m\n", " United States improve_health \u001b[1;36m0.9105\u001b[0m \u001b[1;36m0.0083\u001b[0m \u001b[1;36m0.9222\u001b[0m\n", " United States reduce_crime \u001b[1;36m0.8945\u001b[0m \u001b[1;36m0.0173\u001b[0m \u001b[1;36m0.9188\u001b[0m\n", " United States maximize_wellbeing \u001b[1;36m0.8473\u001b[0m \u001b[1;36m0.0092\u001b[0m \u001b[1;36m0.8593\u001b[0m\n", " India stabilize_economy \u001b[1;36m0.7258\u001b[0m \u001b[1;36m0.0205\u001b[0m \u001b[1;36m0.7502\u001b[0m\n", " India improve_health \u001b[1;36m0.8542\u001b[0m \u001b[1;36m0.0047\u001b[0m \u001b[1;36m0.8590\u001b[0m\n", " India reduce_crime \u001b[1;36m0.8858\u001b[0m \u001b[1;36m0.0074\u001b[0m \u001b[1;36m0.8959\u001b[0m\n", " India maximize_wellbeing \u001b[1;36m0.8157\u001b[0m \u001b[1;36m0.0355\u001b[0m \u001b[1;36m0.8448\u001b[0m\n", "United Kingdom stabilize_economy \u001b[1;36m0.7420\u001b[0m \u001b[1;36m0.0373\u001b[0m \u001b[1;36m0.7943\u001b[0m\n", "United Kingdom improve_health \u001b[1;36m0.8509\u001b[0m \u001b[1;36m0.0226\u001b[0m \u001b[1;36m0.8779\u001b[0m\n", "United Kingdom reduce_crime \u001b[1;36m0.8939\u001b[0m \u001b[1;36m0.0077\u001b[0m \u001b[1;36m0.9005\u001b[0m\n", "United Kingdom maximize_wellbeing \u001b[1;36m0.8112\u001b[0m \u001b[1;36m0.0118\u001b[0m \u001b[1;36m0.8218\u001b[0m\n", " Germany stabilize_economy \u001b[1;36m0.7562\u001b[0m \u001b[1;36m0.0425\u001b[0m \u001b[1;36m0.8156\u001b[0m\n", " Germany improve_health \u001b[1;36m0.8647\u001b[0m \u001b[1;36m0.0126\u001b[0m \u001b[1;36m0.8791\u001b[0m\n", " Germany reduce_crime \u001b[1;36m0.8903\u001b[0m \u001b[1;36m0.0077\u001b[0m \u001b[1;36m0.8970\u001b[0m\n", " Germany maximize_wellbeing \u001b[1;36m0.8107\u001b[0m \u001b[1;36m0.0045\u001b[0m \u001b[1;36m0.8160\u001b[0m\n", " Japan stabilize_economy \u001b[1;36m0.7614\u001b[0m \u001b[1;36m0.0122\u001b[0m \u001b[1;36m0.7758\u001b[0m\n", " Japan improve_health \u001b[1;36m0.8622\u001b[0m \u001b[1;36m0.0035\u001b[0m \u001b[1;36m0.8671\u001b[0m\n", " Japan reduce_crime \u001b[1;36m0.8943\u001b[0m \u001b[1;36m0.0183\u001b[0m \u001b[1;36m0.9123\u001b[0m\n", " Japan maximize_wellbeing \u001b[1;36m0.8385\u001b[0m \u001b[1;36m0.0146\u001b[0m \u001b[1;36m0.8538\u001b[0m\n", " Brazil stabilize_economy \u001b[1;36m0.7127\u001b[0m \u001b[1;36m0.0107\u001b[0m \u001b[1;36m0.7277\u001b[0m\n", " Brazil improve_health \u001b[1;36m0.8521\u001b[0m \u001b[1;36m0.0276\u001b[0m \u001b[1;36m0.8740\u001b[0m\n", " Brazil reduce_crime \u001b[1;36m0.8514\u001b[0m \u001b[1;36m0.0059\u001b[0m \u001b[1;36m0.8597\u001b[0m\n", " Brazil maximize_wellbeing \u001b[1;36m0.7974\u001b[0m \u001b[1;36m0.0056\u001b[0m \u001b[1;36m0.8017\u001b[0m\n" ], "text/html": [ "
country task mean_r std_r max_r\n",
" United States stabilize_economy 0.7832 0.0244 0.8176\n",
" United States improve_health 0.9105 0.0083 0.9222\n",
" United States reduce_crime 0.8945 0.0173 0.9188\n",
" United States maximize_wellbeing 0.8473 0.0092 0.8593\n",
" India stabilize_economy 0.7258 0.0205 0.7502\n",
" India improve_health 0.8542 0.0047 0.8590\n",
" India reduce_crime 0.8858 0.0074 0.8959\n",
" India maximize_wellbeing 0.8157 0.0355 0.8448\n",
"United Kingdom stabilize_economy 0.7420 0.0373 0.7943\n",
"United Kingdom improve_health 0.8509 0.0226 0.8779\n",
"United Kingdom reduce_crime 0.8939 0.0077 0.9005\n",
"United Kingdom maximize_wellbeing 0.8112 0.0118 0.8218\n",
" Germany stabilize_economy 0.7562 0.0425 0.8156\n",
" Germany improve_health 0.8647 0.0126 0.8791\n",
" Germany reduce_crime 0.8903 0.0077 0.8970\n",
" Germany maximize_wellbeing 0.8107 0.0045 0.8160\n",
" Japan stabilize_economy 0.7614 0.0122 0.7758\n",
" Japan improve_health 0.8622 0.0035 0.8671\n",
" Japan reduce_crime 0.8943 0.0183 0.9123\n",
" Japan maximize_wellbeing 0.8385 0.0146 0.8538\n",
" Brazil stabilize_economy 0.7127 0.0107 0.7277\n",
" Brazil improve_health 0.8521 0.0276 0.8740\n",
" Brazil reduce_crime 0.8514 0.0059 0.8597\n",
" Brazil maximize_wellbeing 0.7974 0.0056 0.8017\n",
"\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\n",
"\u001b[1mBaseline \u001b[0m\u001b[1m(\u001b[0m\u001b[1mfixed \u001b[0m\u001b[1;36m0.5\u001b[0m\u001b[1m)\u001b[0m\u001b[1m : \u001b[0m\u001b[1;36m0.8596\u001b[0m\n"
],
"text/html": [
"\n",
"Baseline (fixed 0.5) : 0.8596\n",
"\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32mBest trained score : \u001b[0m\u001b[1;32m0.9105\u001b[0m\n"
],
"text/html": [
"Best trained score : 0.9105\n", "\n" ] }, "metadata": {} } ] }, { "cell_type": "code", "source": [ "pivot = df_eval.pivot(index=\"country\", columns=\"task\", values=\"mean_r\")\n", "\n", "fig_heat = go.Figure(go.Heatmap(\n", " z = pivot.values,\n", " x = pivot.columns.tolist(),\n", " y = pivot.index.tolist(),\n", " colorscale = \"RdYlGn\",\n", " text = np.round(pivot.values, 3),\n", " texttemplate=\"%{text}\",\n", " showscale = True,\n", " zmin=0.4, zmax=1.0,\n", "))\n", "fig_heat.add_shape(\n", " type=\"line\", x0=-0.5, x1=len(pivot.columns)-0.5,\n", " y0=-0.5, y1=len(pivot.index)-0.5,\n", " line=dict(color=\"white\", width=0)\n", ")\n", "fig_heat.update_layout(\n", " title = \"Policy Performance Heatmap — Country × Task (GRPO Trained)\",\n", " template=\"plotly_dark\", height=400,\n", " paper_bgcolor=\"#0d1117\", font=dict(color=\"#e6edf3\"),\n", " xaxis_title=\"Task\", yaxis_title=\"Country\",\n", ")\n", "fig_heat.show()\n", "fig_heat.write_html(\"assets/eval_heatmap.html\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 417 }, "id": "D4IQZzjRHm2J", "outputId": "62fc9a66-986d-49fc-c758-299015385b51" }, "execution_count": 15, "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "
──────────────────────────────────────────────────── All Done ─────────────────────────────────────────────────────\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[32m✓ LoRA checkpoint → checkpoints/civicai-lora/\u001b[0m\n" ], "text/html": [ "
✓ LoRA checkpoint → checkpoints/civicai-lora/\n",
"\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[32m✓ Results JSON → assets/training_results.json\u001b[0m\n"
],
"text/html": [
"✓ Results JSON → assets/training_results.json\n",
"\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[32m✓ Dashboard HTML → assets/global_dashboard.html\u001b[0m\n"
],
"text/html": [
"✓ Dashboard HTML → assets/global_dashboard.html\n",
"\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[32m✓ Training metrics → assets/training_metrics.html\u001b[0m\n"
],
"text/html": [
"✓ Training metrics → assets/training_metrics.html\n",
"\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[32m✓ Eval heatmap → assets/eval_heatmap.html\u001b[0m\n"
],
"text/html": [
"✓ Eval heatmap → assets/eval_heatmap.html\n",
"\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\n",
"\u001b[1;36mBaseline : \u001b[0m\u001b[1;36m0.8596\u001b[0m\n"
],
"text/html": [
"\n",
"Baseline : 0.8596\n",
"\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32mBest score: \u001b[0m\u001b[1;32m0.9105\u001b[0m\n"
],
"text/html": [
"Best score: 0.9105\n", "\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[1;32mDelta : +\u001b[0m\u001b[1;32m0.0509\u001b[0m\n" ], "text/html": [ "
Delta : +0.0509\n", "\n" ] }, "metadata": {} } ] } ], "metadata": { "colab": { "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "002c5b875ba74a659dc47cb255428607": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_2b59d571e1434bb4910c49c76502ac98", "max": 148, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_7e5258c924a04a48ad49dfaec78e6acd", "value": 148 } }, "02ca91e4250f4cf4b6594757905f241a": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_d1b1899bbb1549e8963e360e8e0fe181", "IPY_MODEL_62f0caaed66f48d5b828e1264534b0ca", "IPY_MODEL_d5407a6fe9af4cd9a563fa28d55911db" ], "layout": "IPY_MODEL_0c711677b41547d38486368847f71087" } }, "05e95272692842b29fec8e13f1590bd2": { "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 } }, "0c711677b41547d38486368847f71087": { "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 } }, "0f937b3301c94ecd8f44189ea641c222": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_cfc54026704545d498b3b2d9c0fe912e", "IPY_MODEL_4d9a59f651a04239adde42290ef06c27", "IPY_MODEL_1fb43f8f8fc246768d119411887cd15a" ], "layout": "IPY_MODEL_f969d53f13b0490781bec68dab2d3b13" } }, "117c1bccd8fe4edc9810151d376648ec": { "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 } }, "1265b9cb4cbe428c94c8139a28caff13": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "17400ab03b4d446fbf7a3dfe782ce81c": { "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 } }, "1784d432f2624bcfa5dd18b5334841b6": { "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_18f38e3774ff4e54a77033e3edcc1602", "placeholder": "", "style": "IPY_MODEL_1f49fa468cf343f9ac7385c0c0d1f2cc", "value": "tokenizer.json: " } }, "188f4333d05b4bdb8dbf62f789a45620": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_621d9a6d432840a58a554fbc6cfb3eed", "msg_id": "", "outputs": [ { "data": { "text/html": "
⠦ Fetching live data for United Kingdom\n\n", "text/plain": "\u001b[32m⠦\u001b[0m \u001b[36mFetching live data for United Kingdom\u001b[0m\n" }, "metadata": {}, "output_type": "display_data" } ] } }, "18f38e3774ff4e54a77033e3edcc1602": { "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 } }, "1d8f93d877d247af95b009db2b659a65": { "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 } }, "1f2303b42b3c4340a284c7126cf1fd37": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_c41c26ae9ba443a5b6b942d69cf323be", "msg_id": "", "outputs": [ { "data": { "text/html": "
⠸ Fetching live data for Germany\n\n", "text/plain": "\u001b[32m⠸\u001b[0m \u001b[36mFetching live data for Germany\u001b[0m\n" }, "metadata": {}, "output_type": "display_data" } ] } }, "1f49fa468cf343f9ac7385c0c0d1f2cc": { "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": "" } }, "1fb43f8f8fc246768d119411887cd15a": { "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_46ef40073958467ba658ce4b3e81a001", "placeholder": "", "style": "IPY_MODEL_322b91e9115b41cf9d45f9b9934b8ac0", "value": " 548M/548M [00:10<00:00, 76.2MB/s]" } }, "251d1b70d4234174a02b5b1ad3134cf9": { "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": "" } }, "26a0842343b64124af9603844c4333ed": { "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 } }, "2b59d571e1434bb4910c49c76502ac98": { "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 } }, "2b6ee0bde2114e528e6d13d24e599e75": { "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": "" } }, "2cb61682ebca4c7e91d3990187e8fc72": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "2daeb61435a14098b0b7b19d89c364a3": { "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": "" } }, "2e3c5a92074e43f2be3ac3e5a7eff887": { "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": "" } }, "30551bf982cf4da4904bc0705c316b67": { "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 } }, "322b91e9115b41cf9d45f9b9934b8ac0": { "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": "" } }, "343cacab67b0490cb33d41cf0e9fac58": { "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 } }, "38e25d69edbc44d8bbedc4e8e7f62e39": { "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 } }, "3934fc86b5ee46edba6b0fac99d1af85": { "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": "20px" } }, "3c361255933741089182c76f833bc2c7": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_b38158c0ff0c432893a6e8420cb5f6a9", "msg_id": "", "outputs": [ { "data": { "text/html": "
⠙ Fetching live data for Japan\n\n", "text/plain": "\u001b[32m⠙\u001b[0m \u001b[36mFetching live data for Japan\u001b[0m\n" }, "metadata": {}, "output_type": "display_data" } ] } }, "3f6ada08370341f89dbda7720a82c05a": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_1d8f93d877d247af95b009db2b659a65", "msg_id": "", "outputs": [ { "data": { "text/html": "
⠙ Fetching live data for Brazil\n\n", "text/plain": "\u001b[32m⠙\u001b[0m \u001b[36mFetching live data for Brazil\u001b[0m\n" }, "metadata": {}, "output_type": "display_data" } ] } }, "41e3b142a4f04dd3a2584d5c445d0e00": { "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 } }, "46ef40073958467ba658ce4b3e81a001": { "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 } }, "4d9a59f651a04239adde42290ef06c27": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_5d97e8b1de6b460d85761a8278c1a1cf", "max": 548105171, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_2cb61682ebca4c7e91d3990187e8fc72", "value": 548105171 } }, "4e2f15ea286047cca301ad89c077d7ed": { "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_f775e249d9c84757aec02b8636738cae", "placeholder": "", "style": "IPY_MODEL_c6f1bc21756b4fa59a26a78f75fe09f3", "value": "tokenizer_config.json: 100%" } }, "5074b39aac7e43f295767192a8c6dfae": { "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 } }, "556f537c832549b487c7fe839df06a0b": { "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 } }, "56aa5c6733f64871991da63b9935fe7c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_b65f5c5428fb4d63b9aab0f7b7eb5fbc", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_f40ea52496054b93bc870ad63ab74620", "value": 1 } }, "5cbc45a0bc104745bbceef8b08a25096": { "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": "" } }, "5cea20a59959417f9bbf5c39a9b164b0": { "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_6f13dd2d836746d0ba7673eb5fbd48a5", "placeholder": "", "style": "IPY_MODEL_93544687cf294c6a92bd1ef0f03a99ae", "value": " 1.04M/? [00:00<00:00, 11.5MB/s]" } }, "5d97e8b1de6b460d85761a8278c1a1cf": { "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 } }, "5f2f567bddf541e8bfa37f2bd9035be4": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_b184d765f69544bf9a23de55bf49ebf9", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_a7e9986b10de4d6fa6f9db861ef9358c", "value": 1 } }, "5fe527612db54e99be88c941ff881349": { "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_b946b8a284b54356be0f851a9fe106d4", "placeholder": "", "style": "IPY_MODEL_a1bdee8bd9ae42a790c38f17155d22b8", "value": " 148/148 [00:00<00:00, 508.03it/s, Materializing param=transformer.wte.weight]" } }, "620648632beb481992e028d298741c1d": { "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 } }, "621d9a6d432840a58a554fbc6cfb3eed": { "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 } }, "62f0caaed66f48d5b828e1264534b0ca": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_556f537c832549b487c7fe839df06a0b", "max": 124, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_1265b9cb4cbe428c94c8139a28caff13", "value": 124 } }, "685fe3a6d0a2465dad35c68d2b99c249": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "6d28bfa916954318963806caaae2da5f": { "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_8bfac1c2c09642b284bac6cc598a95cf", "placeholder": "", "style": "IPY_MODEL_ab8dd52e79134a50b39893a2da744d57", "value": " 665/665 [00:00<00:00, 19.6kB/s]" } }, "6f13dd2d836746d0ba7673eb5fbd48a5": { "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 } }, "70ce11abac5f4e11a1ff84dd5ede2fff": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "7db3437ccf2b430c9e795364df69595c": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_5074b39aac7e43f295767192a8c6dfae", "msg_id": "", "outputs": [ { "data": { "text/html": "
⠼ Fetching live data for India\n\n", "text/plain": "\u001b[32m⠼\u001b[0m \u001b[36mFetching live data for India\u001b[0m\n" }, "metadata": {}, "output_type": "display_data" } ] } }, "7e5258c924a04a48ad49dfaec78e6acd": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "83702cefabd54c4386825ce0ab727df7": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_9e507b28664d471bae14f6776c1c5b13", "IPY_MODEL_5f2f567bddf541e8bfa37f2bd9035be4", "IPY_MODEL_a45f3f86598c45c9bcfeac4a0887a706" ], "layout": "IPY_MODEL_30551bf982cf4da4904bc0705c316b67" } }, "83e967db50144bbf8feda1660679e154": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_1784d432f2624bcfa5dd18b5334841b6", "IPY_MODEL_56aa5c6733f64871991da63b9935fe7c", "IPY_MODEL_88d31aba4a3247b792c463db856904a0" ], "layout": "IPY_MODEL_05e95272692842b29fec8e13f1590bd2" } }, "87261748ca7d4941a4239b76c10fd8f9": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_feca60e38be4482bb2a967e7226e1994", "IPY_MODEL_9eeeff30b9944af2bbae91e3e68a042b", "IPY_MODEL_6d28bfa916954318963806caaae2da5f" ], "layout": "IPY_MODEL_bef2b1f1f0f0410ba5d1ff74a31f272a" } }, "88d31aba4a3247b792c463db856904a0": { "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_38e25d69edbc44d8bbedc4e8e7f62e39", "placeholder": "", "style": "IPY_MODEL_a6e6bf298f3d4112b714b457af607f2b", "value": " 1.36M/? [00:00<00:00, 13.3MB/s]" } }, "8bfac1c2c09642b284bac6cc598a95cf": { "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 } }, "8e7c4059aece4a01b37dbb1800d1cedd": { "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": "" } }, "93544687cf294c6a92bd1ef0f03a99ae": { "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": "" } }, "952181added44a1794fe7011f1af0816": { "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 } }, "953b658c117d42cd89adfa93e1deadf8": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_f9dbada0887f4821a9c417ecbfdacc32", "IPY_MODEL_002c5b875ba74a659dc47cb255428607", "IPY_MODEL_5fe527612db54e99be88c941ff881349" ], "layout": "IPY_MODEL_17400ab03b4d446fbf7a3dfe782ce81c" } }, "9895d266524c4a9c817912cdb008677a": { "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 } }, "992fdf808c82423d9090b2aaafe10aed": { "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 } }, "9e507b28664d471bae14f6776c1c5b13": { "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_fec2b63e94e6463480e2b228b8ff9a0b", "placeholder": "", "style": "IPY_MODEL_2b6ee0bde2114e528e6d13d24e599e75", "value": "merges.txt: " } }, "9eeeff30b9944af2bbae91e3e68a042b": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_992fdf808c82423d9090b2aaafe10aed", "max": 665, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_70ce11abac5f4e11a1ff84dd5ede2fff", "value": 665 } }, "a1bdee8bd9ae42a790c38f17155d22b8": { "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": "" } }, "a20bc44d88f84906b2413b9057ec2f6c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_26a0842343b64124af9603844c4333ed", "max": 26, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_685fe3a6d0a2465dad35c68d2b99c249", "value": 26 } }, "a45f3f86598c45c9bcfeac4a0887a706": { "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_b0d3193d8ff4483f81ccc3bdb3fdd7b7", "placeholder": "", "style": "IPY_MODEL_5cbc45a0bc104745bbceef8b08a25096", "value": " 456k/? [00:00<00:00, 8.59MB/s]" } }, "a59d7ac091e049559ca0f88a46dc6e58": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_3934fc86b5ee46edba6b0fac99d1af85", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_ba60d1545da64fdc933f56722550def0", "value": 1 } }, "a6e6bf298f3d4112b714b457af607f2b": { "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": "" } }, "a7e9986b10de4d6fa6f9db861ef9358c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "ab8dd52e79134a50b39893a2da744d57": { "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": "" } }, "abb338ad3f6346ca812c1fad388f2934": { "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": "" } }, "b0d3193d8ff4483f81ccc3bdb3fdd7b7": { "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 } }, "b184d765f69544bf9a23de55bf49ebf9": { "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": "20px" } }, "b36631dd86e245daaaaf70188a64e9aa": { "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_41e3b142a4f04dd3a2584d5c445d0e00", "placeholder": "", "style": "IPY_MODEL_251d1b70d4234174a02b5b1ad3134cf9", "value": " 26.0/26.0 [00:00<00:00, 1.02kB/s]" } }, "b38158c0ff0c432893a6e8420cb5f6a9": { "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 } }, "b65f5c5428fb4d63b9aab0f7b7eb5fbc": { "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": "20px" } }, "b946b8a284b54356be0f851a9fe106d4": { "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 } }, "ba60d1545da64fdc933f56722550def0": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "bad878c955db49398e731b6473be0842": { "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 } }, "bef2b1f1f0f0410ba5d1ff74a31f272a": { "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 } }, "c41c26ae9ba443a5b6b942d69cf323be": { "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 } }, "c6f1bc21756b4fa59a26a78f75fe09f3": { "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": "" } }, "c8ccd98c81f1465ca4ddc82cc54ffc4c": { "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 } }, "cd67a1ff8b1441aba237c1d4d4ea6ee3": { "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": "" } }, "cfc54026704545d498b3b2d9c0fe912e": { "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_117c1bccd8fe4edc9810151d376648ec", "placeholder": "", "style": "IPY_MODEL_8e7c4059aece4a01b37dbb1800d1cedd", "value": "model.safetensors: 100%" } }, "d1b1899bbb1549e8963e360e8e0fe181": { "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_f5b03dbb98fd47569f4836ed46face4b", "placeholder": "", "style": "IPY_MODEL_2daeb61435a14098b0b7b19d89c364a3", "value": "generation_config.json: 100%" } }, "d5407a6fe9af4cd9a563fa28d55911db": { "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_c8ccd98c81f1465ca4ddc82cc54ffc4c", "placeholder": "", "style": "IPY_MODEL_2e3c5a92074e43f2be3ac3e5a7eff887", "value": " 124/124 [00:00<00:00, 4.51kB/s]" } }, "d68aea2f8b0044ebb2524fe8ac6ec1fd": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_f207f79ce9444a8eaddf88fe21116aaa", "IPY_MODEL_a59d7ac091e049559ca0f88a46dc6e58", "IPY_MODEL_5cea20a59959417f9bbf5c39a9b164b0" ], "layout": "IPY_MODEL_d6e0edad338e4d83bc61a3a83cca20da" } }, "d6e0edad338e4d83bc61a3a83cca20da": { "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 } }, "d8c68d58a5644e908aaf15954041deab": { "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": "" } }, "e2df56f4da4345ecaad24e0e33128dd5": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_4e2f15ea286047cca301ad89c077d7ed", "IPY_MODEL_a20bc44d88f84906b2413b9057ec2f6c", "IPY_MODEL_b36631dd86e245daaaaf70188a64e9aa" ], "layout": "IPY_MODEL_952181added44a1794fe7011f1af0816" } }, "f207f79ce9444a8eaddf88fe21116aaa": { "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_bad878c955db49398e731b6473be0842", "placeholder": "", "style": "IPY_MODEL_abb338ad3f6346ca812c1fad388f2934", "value": "vocab.json: " } }, "f40ea52496054b93bc870ad63ab74620": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "f5b03dbb98fd47569f4836ed46face4b": { "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 } }, "f775e249d9c84757aec02b8636738cae": { "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 } }, "f83489a9561a4b73b8d8eddc4b00c34e": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_9895d266524c4a9c817912cdb008677a", "msg_id": "", "outputs": [ { "data": { "text/html": "
⠧ Fetching live data for United States\n\n", "text/plain": "\u001b[32m⠧\u001b[0m \u001b[36mFetching live data for United States\u001b[0m\n" }, "metadata": {}, "output_type": "display_data" } ] } }, "f969d53f13b0490781bec68dab2d3b13": { "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 } }, "f9dbada0887f4821a9c417ecbfdacc32": { "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_620648632beb481992e028d298741c1d", "placeholder": "", "style": "IPY_MODEL_d8c68d58a5644e908aaf15954041deab", "value": "Loading weights: 100%" } }, "fec2b63e94e6463480e2b228b8ff9a0b": { "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 } }, "feca60e38be4482bb2a967e7226e1994": { "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_343cacab67b0490cb33d41cf0e9fac58", "placeholder": "", "style": "IPY_MODEL_cd67a1ff8b1441aba237c1d4d4ea6ee3", "value": "config.json: 100%" } }, "944c40ec95e2465b80a72fe81442e073": { "model_module": "@jupyter-widgets/output", "model_name": "OutputModel", "model_module_version": "1.0.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_a0072b2ff8f248ee982b67801e2cffc9", "msg_id": "", "outputs": [] } }, "199c4f4f31ec433da34dee3590ad38b6": { "model_module": "@jupyter-widgets/output", "model_name": "OutputModel", "model_module_version": "1.0.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_d4a36794d9bb4fa2902e663362155463", "msg_id": "", "outputs": [] } }, "1d6a657594c449bdb5ca00ebf53b81c2": { "model_module": "@jupyter-widgets/output", "model_name": "OutputModel", "model_module_version": "1.0.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_f943bfea7b104828a363c497a51ca06f", "msg_id": "", "outputs": [] } }, "2e3785dcd8d94fc79e6ecd58ec844004": { "model_module": "@jupyter-widgets/output", "model_name": "OutputModel", "model_module_version": "1.0.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_3f79198a27234b4f8ce502a7c3249212", "msg_id": "", "outputs": [] } }, "e538d2d016904a349c4a6f02ac2f8431": { "model_module": "@jupyter-widgets/output", "model_name": "OutputModel", "model_module_version": "1.0.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_c31f513bd8d44e85894104063b133f65", "msg_id": "", "outputs": [] } }, "b1c8740b107b4efba749a80fe16dea9a": { "model_module": "@jupyter-widgets/output", "model_name": "OutputModel", "model_module_version": "1.0.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_fa5bf9e609f04d169eed9927c0b63920", "msg_id": "", "outputs": [] } } } } }, "nbformat": 4, "nbformat_minor": 0 }