{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19", "_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5", "execution": { "iopub.execute_input": "2026-09-02T10:03:29.342587Z", "iopub.status.busy": "2026-09-02T10:03:29.341720Z", "iopub.status.idle": "2026-09-02T10:04:26.264651Z", "shell.execute_reply": "2026-09-02T10:04:26.263762Z", "shell.execute_reply.started": "2026-09-02T10:03:29.342555Z" }, "trusted": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.1/12.1 MB\u001b[0m \u001b[31m89.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m775.8/775.8 kB\u001b[0m \u001b[31m43.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m43.1/43.1 MB\u001b[0m \u001b[31m40.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m00:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m559.1/559.1 kB\u001b[0m \u001b[31m32.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m389.2/389.2 kB\u001b[0m \u001b[31m20.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m516.0/516.0 kB\u001b[0m \u001b[31m30.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.3/3.3 MB\u001b[0m \u001b[31m82.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m544.8/544.8 kB\u001b[0m \u001b[31m9.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mta \u001b[36m0:00:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.0/67.0 kB\u001b[0m \u001b[31m2.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m506.8/506.8 kB\u001b[0m \u001b[31m12.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.8/73.8 kB\u001b[0m \u001b[31m4.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.2/10.2 MB\u001b[0m \u001b[31m91.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m0:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.5/1.5 MB\u001b[0m \u001b[31m67.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.3/3.3 MB\u001b[0m \u001b[31m84.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.6/3.6 MB\u001b[0m \u001b[31m95.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m216.9/216.9 kB\u001b[0m \u001b[31m14.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m88.7/88.7 MB\u001b[0m \u001b[31m21.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m00:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m119.7/119.7 kB\u001b[0m \u001b[31m7.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.3/3.3 MB\u001b[0m \u001b[31m86.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.4/3.4 MB\u001b[0m \u001b[31m91.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m225.0/225.0 kB\u001b[0m \u001b[31m15.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h✅ Dependencies installed\n" ] } ], "source": [ "!pip install -q transformers peft bitsandbytes datasets accelerate -U\n", "!pip install -q trl==0.22.2\n", "!pip install -q unsloth[kaggle] --upgrade\n", "print(\"✅ Dependencies installed\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T10:04:42.174302Z", "iopub.status.busy": "2026-09-02T10:04:42.173940Z", "iopub.status.idle": "2026-09-02T10:04:43.210561Z", "shell.execute_reply": "2026-09-02T10:04:43.210003Z", "shell.execute_reply.started": "2026-09-02T10:04:42.174270Z" }, "trusted": true }, "outputs": [], "source": [ "from huggingface_hub import login\n", "\n", "# Paste your actual token string inside the quotes\n", "login(token=\"\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T10:06:51.583913Z", "iopub.status.busy": "2026-09-02T10:06:51.582929Z", "iopub.status.idle": "2026-09-02T10:06:51.613020Z", "shell.execute_reply": "2026-09-02T10:06:51.612201Z", "shell.execute_reply.started": "2026-09-02T10:06:51.583873Z" }, "trusted": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "✅ Successfully generated 203 training examples in 'agriculture_training_data.json'!\n" ] } ], "source": [ "import json\n", "import random\n", "\n", "# Complete knowledge base covering all plant disease and pest classes\n", "agri_knowledge_base = [\n", " {\n", " \"class_name\": \"Apple___Apple_scab\",\n", " \"symptoms\": \"olive-green to black velvety spots on leaves, puckered foliage, and dark corky lesions on fruit\",\n", " \"treatment\": \"Spray Captan (2 g/L) or Mancozeb (2.5 g/L) starting from the green-tip bud stage through petal fall.\",\n", " \"organic\": \"Apply sulfur dust (3 g/L) or spray diluted neem oil emulsion early morning.\",\n", " \"prevention\": \"Prune dense canopies to maximize sunlight and rake/burn fallen leaves in autumn.\"\n", " },\n", " {\n", " \"class_name\": \"Apple___Black_rot\",\n", " \"symptoms\": \"purple flecks on leaves expanding into frog-eye spots, black mummified fruit on branches, and sunken bark cankers\",\n", " \"treatment\": \"Prune out diseased twigs 15 cm below infected tissue and spray Thiophanate-methyl or copper oxychloride.\",\n", " \"organic\": \"Prune infected limbs during dry weather and apply liquid copper spray before spring bud break.\",\n", " \"prevention\": \"Remove dead wood and mummified apples from the orchard floor immediately.\"\n", " },\n", " {\n", " \"class_name\": \"Apple___Cedar_apple_rust\",\n", " \"symptoms\": \"bright yellow-orange circular spots on upper leaf surfaces with tiny black dots, followed by tube-like projections underneath\",\n", " \"treatment\": \"Apply Myclobutanil or Trifloxystrobin every 7 to 10 days from pink bud stage through bloom.\",\n", " \"organic\": \"Spray sulfur fungicides at pink stage and physically prune nearby alternate host cedar trees.\",\n", " \"prevention\": \"Remove eastern red cedar/juniper trees within a 500-meter radius of the apple orchard.\"\n", " },\n", " {\n", " \"class_name\": \"Cherry_(including_sour)___Powdery_mildew\",\n", " \"symptoms\": \"white powdery fungal patches on new leaf flushes, curling leaf margins, and stunted terminal shoot growth\",\n", " \"treatment\": \"Apply Hexaconazole (1 ml/L) or Tebuconazole (1 ml/L) at petal fall and repeat after 14 days.\",\n", " \"organic\": \"Spray potassium bicarbonate (3 g/L) mixed with horticultural oil or 3% neem oil.\",\n", " \"prevention\": \"Maintain wide tree spacing, minimize overhead sprinkler irrigation, and avoid excess nitrogen.\"\n", " },\n", " {\n", " \"class_name\": \"Corn_(maize)___Cercospora_leaf_spot Gray_leaf_spot\",\n", " \"symptoms\": \"small, rectangular, tan-to-gray lesions restricted by leaf veins, coalescing into extensive blighted strips\",\n", " \"treatment\": \"Spray Pyraclostrobin + Epoxiconazole or Azoxystrobin (1 ml/L) when lesions reach the ear leaf during tasseling.\",\n", " \"organic\": \"Apply biological Trichoderma viride formulations to soil and foliar bio-fungicides.\",\n", " \"prevention\": \"Practice 2-year crop rotation with non-host crops and adopt tillage to bury infected corn residue.\"\n", " },\n", " {\n", " \"class_name\": \"Corn_(maize)___Common_rust_\",\n", " \"symptoms\": \"small, reddish-brown to dark brown pustules on both upper and lower leaf surfaces that rupture to release powdery spores\",\n", " \"treatment\": \"Apply Mancozeb (2.5 g/L) or Propiconazole (1 ml/L) if rust appears prior to the silking stage.\",\n", " \"organic\": \"Dust with fine wettable sulfur early in the morning when dew is present.\",\n", " \"prevention\": \"Plant resistant hybrid seed varieties and sow early in the season to evade peak spore loads.\"\n", " },\n", " {\n", " \"class_name\": \"Corn_(maize)___Northern_Leaf_Blight\",\n", " \"symptoms\": \"long, elliptical, grayish-green or tan cigar-shaped lesions on leaves, typically starting on lower canopy leaves\",\n", " \"treatment\": \"Spray Azoxystrobin or Propiconazole (1 ml/L) at first symptom onset during humid weather.\",\n", " \"organic\": \"Remove lower blighted leaves manually and apply Bacillus subtilis bio-spray.\",\n", " \"prevention\": \"Rotate with legumes or oilseeds and deep plow crop residues right after harvest.\"\n", " },\n", " {\n", " \"class_name\": \"Grape___Black_rot\",\n", " \"symptoms\": \"small brown circular leaf lesions with dark margins and black pycnidia, berries turning into hard, shriveled black mummies\",\n", " \"treatment\": \"Spray Mancozeb (2 g/L) or Difenoconazole (0.5 ml/L) before bloom and repeat every 10-14 days.\",\n", " \"organic\": \"Apply copper hydroxide (Bordeaux mixture 1%) during early vine growth.\",\n", " \"prevention\": \"Remove all mummified fruit clusters during winter pruning and thin vine canopy for rapid air drying.\"\n", " },\n", " {\n", " \"class_name\": \"Grape___Esca_(Black_Measles)\",\n", " \"symptoms\": \"tiger-stripe leaf discoloration with yellow and brown bands between veins, dark spots on grape skin, and vine apoplexy\",\n", " \"treatment\": \"No chemical cure exists for infected trunk wood; prune back infected cordons into healthy wood and seal cuts with wound paste.\",\n", " \"organic\": \"Apply Trichoderma-based bio-protectants to large pruning wounds immediately.\",\n", " \"prevention\": \"Sterilize pruning shears with 70% alcohol between vines and delay winter pruning until dry weather.\"\n", " },\n", " {\n", " \"class_name\": \"Grape___Leaf_blight_(Isariopsis_Leaf_Spot)\",\n", " \"symptoms\": \"irregular brown spots with faint yellow halos on leaves, turning dark with velvety fungal growth on the underside\",\n", " \"treatment\": \"Spray Chlorothalonil (2 g/L) or Carbendazim (1 g/L) at first symptom detection.\",\n", " \"organic\": \"Spray 1% Bordeaux mixture or copper oxychloride solution.\",\n", " \"prevention\": \"Maintain proper shoot positioning on trellises and clean up fallen vineyard foliage.\"\n", " },\n", " {\n", " \"class_name\": \"Orange___Haunglongbing_(Citrus_greening)\",\n", " \"symptoms\": \"asymmetric blotchy yellow mottle on leaves, yellow shoots, stunted trees, and small, bitter, lopsided green fruit\",\n", " \"treatment\": \"No cure for the systemic bacterium; eradicate infected trees immediately and control the Asian Citrus Psyllid vector with Imidacloprid (0.5 ml/L).\",\n", " \"organic\": \"Use yellow sticky cards, spray high-grade horticultural mineral oil, and release Tamarixia radiata parasitoid wasps.\",\n", " \"prevention\": \"Plant only certified disease-free nursery saplings and aggressively control psyllid vectors.\"\n", " },\n", " {\n", " \"class_name\": \"Peach___Bacterial_spot\",\n", " \"symptoms\": \"angular, water-soaked, purple-black lesions on leaves that drop out giving a shot-hole look, plus cratered fruit\",\n", " \"treatment\": \"Apply copper bactericide sprays at leaf fall and low-rate copper or Oxytetracycline during the growing season.\",\n", " \"organic\": \"Apply dilute copper sulfate before bud swelling and avoid broad-spectrum chemical sprays.\",\n", " \"prevention\": \"Avoid planting in light sandy soils without windbreaks and avoid overhead irrigation.\"\n", " },\n", " {\n", " \"class_name\": \"Pepper,_bell___Bacterial_spot\",\n", " \"symptoms\": \"small, dark, greasy water-soaked spots on leaf undersides, premature yellowing, defoliation, and rough raised spots on peppers\",\n", " \"treatment\": \"Spray Copper Hydroxide (2 g/L) combined with Mancozeb (2 g/L) weekly under warm, wet conditions.\",\n", " \"organic\": \"Soak seeds in hot water (50°C for 25 mins) before sowing and apply Streptomyces-based bio-agents.\",\n", " \"prevention\": \"Use certified pathogen-free seeds, practice 3-year solanaceous crop rotation, and avoid handling wet plants.\"\n", " },\n", " {\n", " \"class_name\": \"Potato___Early_blight\",\n", " \"symptoms\": \"brown-to-black spots with characteristic concentric rings (target-board pattern) starting on older lower foliage\",\n", " \"treatment\": \"Spray Mancozeb (2.5 g/L) or Chlorothalonil (2 g/L) at initial spot appearance, repeating every 7-10 days.\",\n", " \"organic\": \"Apply liquid copper spray or a 5% neem seed kernel extract (NSKE) foliar spray.\",\n", " \"prevention\": \"Maintain balanced plant nutrition (avoid nitrogen deficiency) and water the furrow, not the foliage.\"\n", " },\n", " {\n", " \"class_name\": \"Potato___Late_blight\",\n", " \"symptoms\": \"large, irregular water-soaked pale-to-dark green lesions on leaves/stems, rapidly turning brown-black with white mildew underneath\",\n", " \"treatment\": \"Apply systemic Metalaxyl-M + Mancozeb (2.5 g/L) or Cymoxanil immediately; destroy severely diseased plants.\",\n", " \"organic\": \"Spray 1% Bordeaux mixture preventatively before continuous rainy spells.\",\n", " \"prevention\": \"Use certified blight-free seed tubers, hill up soil ridges to cover tubers, and cull volunteer potato plants.\"\n", " },\n", " {\n", " \"class_name\": \"Squash___Powdery_mildew\",\n", " \"symptoms\": \"talcum-powder-like white fungal colonies on upper and lower surfaces of older leaves, causing yellowing and premature leaf crisping\",\n", " \"treatment\": \"Spray Azoxystrobin (1 ml/L) or Myclobutanil (0.5 ml/L) upon observing the first white spots.\",\n", " \"organic\": \"Spray a 1:9 milk-to-water solution or potassium bicarbonate (3 g/L) plus neem oil weekly.\",\n", " \"prevention\": \"Plant resistant squash varieties, space hills 1-1.5 meters apart, and plant in full sun.\"\n", " },\n", " {\n", " \"class_name\": \"Strawberry___Leaf_scorch\",\n", " \"symptoms\": \"numerous small, irregular purple-to-brown blotches on leaves that enlarge and dry up, making leaves look burnt\",\n", " \"treatment\": \"Apply Captan (2 g/L) or Pyraclostrobin-based fungicides at early spring renovation.\",\n", " \"organic\": \"Spray copper-based bio-fungicides and remove scorch-damaged crowns.\",\n", " \"prevention\": \"Set plants in well-drained raised beds, use drip irrigation, and remove old leaf debris post-harvest.\"\n", " },\n", " {\n", " \"class_name\": \"Tomato___Bacterial_spot\",\n", " \"symptoms\": \"tiny water-soaked black spots surrounded by yellow halos on leaves, causing leaf drop and sunscald on exposed fruit\",\n", " \"treatment\": \"Spray copper oxychloride (2.5 g/L) tank-mixed with Mancozeb (2 g/L) every 7-10 days.\",\n", " \"organic\": \"Spray copper sulfate pentahydrate and use Bacillus amyloliquefaciens biopesticide.\",\n", " \"prevention\": \"Treat seed with 1.3% sodium hypochlorite before planting and sanitize all tomato stakes and cages.\"\n", " },\n", " {\n", " \"class_name\": \"Tomato___Early_blight\",\n", " \"symptoms\": \"dark brown circular spots with distinct concentric target rings on bottom leaves, progressing upward with yellow halos\",\n", " \"treatment\": \"Apply Mancozeb (2.5 g/L) or Azoxystrobin + Difenoconazole (1 ml/L) every 10 days.\",\n", " \"organic\": \"Mulch beds with straw, prune the lowest 30 cm of foliage, and apply copper fungicide spray.\",\n", " \"prevention\": \"Follow a strict 3-year non-solanaceous crop rotation and stake plants off the ground.\"\n", " },\n", " {\n", " \"class_name\": \"Tomato___Late_blight\",\n", " \"symptoms\": \"large, dark, greasy-looking water-soaked lesions on foliage, white fungal fuzz on leaf undersides, and brown rot on green tomatoes\",\n", " \"treatment\": \"Spray Dimethomorph (1 g/L) or Metalaxyl + Mancozeb (2.5 g/L) at the earliest sign of disease.\",\n", " \"organic\": \"Spray copper hydroxide preventatively before cool, humid weather sets in.\",\n", " \"prevention\": \"Do not plant tomatoes next to potatoes, ensure adequate air flow, and immediately bag and destroy blighted vines.\"\n", " },\n", " {\n", " \"class_name\": \"Tomato___Leaf_Mold\",\n", " \"symptoms\": \"pale green to light yellow patches on upper leaf surfaces matching olive-green to brown velvety mold on leaf undersides\",\n", " \"treatment\": \"Apply Difenoconazole (0.5 ml/L) or Chlorothalonil (2 g/L) targeting both sides of the leaves.\",\n", " \"organic\": \"Spray copper octanoate or dilute neem oil; increase ventilation in polyhouse environments.\",\n", " \"prevention\": \"Keep greenhouse relative humidity below 85% and prune suckers to improve internal air movement.\"\n", " },\n", " {\n", " \"class_name\": \"Tomato___Septoria_leaf_spot\",\n", " \"symptoms\": \"numerous small circular spots with gray-white centers and dark brown margins studded with tiny black fruiting specs\",\n", " \"treatment\": \"Spray Chlorothalonil (2 g/L) or Mancozeb (2.5 g/L) as soon as symptoms appear on lower leaves.\",\n", " \"organic\": \"Strip off infected bottom leaves and spray liquid copper fungicide.\",\n", " \"prevention\": \"Use clean plastic mulch over soil, avoid wetting the foliage, and destroy tomato plant residue at season's end.\"\n", " },\n", " {\n", " \"class_name\": \"Tomato___Spider_mites Two-spotted_spider_mite\",\n", " \"symptoms\": \"fine yellow stippling/flecking across leaves, webbing on leaf undersides and branch forks, leaves drying to bronze\",\n", " \"treatment\": \"Spray Abamectin (0.5 ml/L), Spiromesifen (1 ml/L), or Propargite (2 ml/L) ensuring complete under-leaf coverage.\",\n", " \"organic\": \"Spray high-pressure water streams to dislodge mites, followed by 2% horticultural soap or pure neem oil spray.\",\n", " \"prevention\": \"Maintain field moisture to avoid dusty drought conditions that foster mite explosions and preserve predatory mites.\"\n", " },\n", " {\n", " \"class_name\": \"Tomato___Target_Spot\",\n", " \"symptoms\": \"small brown pinpoint lesions expanding into necrotic spots with faint concentric rings and yellow halos on leaves and fruit\",\n", " \"treatment\": \"Apply Azoxystrobin (1 ml/L) or Boscalid (1 g/L) when lower leaves begin showing symptoms.\",\n", " \"organic\": \"Prune foliage to open canopy, mulch rows, and apply bio-fungicide Bacillus subtilis.\",\n", " \"prevention\": \"Maintain adequate plant spacing, avoid excessive nitrogen which creates dense foliage, and sanitize stakes.\"\n", " },\n", " {\n", " \"class_name\": \"Tomato___Tomato_Yellow_Leaf_Curl_Virus\",\n", " \"symptoms\": \"severe upward curling and cupping of leaf margins, yellowing (chlorosis) between veins, stunted bushy growth, and fruit drop\",\n", " \"treatment\": \"No chemical virucide exists. Control the whitefly insect vector immediately using Acetamiprid (0.4 g/L) or Thiamethoxam (0.3 g/L).\",\n", " \"organic\": \"Install yellow sticky traps (30 per acre), cover nurseries with 50-mesh insect nets, and spray 3% neem oil.\",\n", " \"prevention\": \"Plant TYLCV-resistant tomato hybrids and remove/bag virus-infected plants immediately to prevent whitefly transmission.\"\n", " },\n", " {\n", " \"class_name\": \"Tomato___Tomato_mosaic_virus\",\n", " \"symptoms\": \"mottled dark and light green mosaic pattern on leaves, leaf distortion (shoestring effect), stunted vines, and internal fruit browning\",\n", " \"treatment\": \"No chemical cure. Remove and burn infected plants immediately; wash hands and tools with 10% trisodium phosphate (TSP) or skim milk.\",\n", " \"organic\": \"Disinfect all tools, cull infected plants, and avoid handling tobacco products near crops.\",\n", " \"prevention\": \"Use virus-tested seeds, clean nursery trays, and plant mosaic-resistant varieties (Tm-2/Tm-2^2 gene).\"\n", " },\n", " {\n", " \"class_name\": \"Cauliflower___Black_Rot\",\n", " \"symptoms\": \"V-shaped yellow chlorotic lesions starting at leaf margins with blackened leaf veins and darkened internal vascular ring\",\n", " \"treatment\": \"Spray Copper Oxychloride (2.5 g/L) combined with Streptocycline (0.1 g/L) at first symptom onset.\",\n", " \"organic\": \"Hot water seed treatment at 50°C for 30 minutes, followed by spraying plant extract of Trichoderma.\",\n", " \"prevention\": \"Practice 3-year rotation away from cruciferous crops, ensure well-drained soil, and control flea beetles.\"\n", " },\n", " {\n", " \"class_name\": \"Cauliflower___Insect_Hole_Pest\",\n", " \"symptoms\": \"perforated leaves with ragged holes, chewed curd heads, visible dark frass/droppings caused by Diamondback moth or Cabbage looper\",\n", " \"treatment\": \"Spray Emamectin Benzoate (0.5 g/L), Spinosad (0.3 ml/L), or Chlorantraniliprole (0.3 ml/L) during evening hours.\",\n", " \"organic\": \"Apply Bacillus thuringiensis (Bt var. kurstaki @ 2 g/L) or spray 5% Neem Seed Kernel Extract (NSKE).\",\n", " \"prevention\": \"Install pheromone traps (8-10 per acre), use mustard as a trap crop around cauliflower borders, and hand-pick larvae.\"\n", " },\n", " {\n", " \"class_name\": \"Healthy_Crop_Maintenance\",\n", " \"symptoms\": \"vibrant green foliage, sturdy stems, active blossom set, and absence of fungal spots, lesions, or insect feeding marks\",\n", " \"treatment\": \"Continue regular agronomic care: provide balanced NPK fertilization, maintain uniform soil moisture, and scout weekly.\",\n", " \"organic\": \"Apply well-decomposed farmyard manure (FYM) or vermicompost along with bi-weekly Jeevamrutha drenches.\",\n", " \"prevention\": \"Maintain clean field borders, practice crop rotation, install bird perches, and avoid over-fertilization.\"\n", " }\n", "]\n", "\n", "system_instruction = \"You are AgriVani, an expert agricultural advisor for Indian farmers. Provide clear, actionable, and empathetic farming advice in simple language.\"\n", "\n", "training_examples = []\n", "\n", "# Generate 7 distinct conversational angles for every single class entry (29 classes * 7 = 203 high-quality examples)\n", "for entry in agri_knowledge_base:\n", " clean_name = entry[\"class_name\"].replace(\"___\", \" - \").replace(\"_\", \" \")\n", " \n", " # 1. Direct Computer Vision Diagnostic Trigger\n", " training_examples.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"AgriVani scan detected {clean_name}. Symptoms visible: {entry['symptoms']}. What should I do right now?\",\n", " \"output\": f\"**Immediate Action Plan for {clean_name}:**\\n\\n- **Treatment:** {entry['treatment']}\\n- **Long-term Protection:** {entry['prevention']}\"\n", " })\n", " \n", " # 2. Organic / Chemical-Free Method Query\n", " training_examples.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"My crop is affected by {clean_name}. I only do organic farming. How can I control it naturally?\",\n", " \"output\": f\"**Organic Management for {clean_name}:**\\n\\n- **Natural Solution:** {entry['organic']}\\n- **Cultural Practice:** {entry['prevention']}\"\n", " })\n", " \n", " # 3. Preventive Strategy Query\n", " training_examples.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"How do I prevent {clean_name} from damaging my field this season?\",\n", " \"output\": f\"**Prevention Guidelines for {clean_name}:**\\n\\n- **Key Preventive Steps:** {entry['prevention']}\\n- **Early Warning Signs:** Watch out for {entry['symptoms']}.\"\n", " })\n", " \n", " # 4. Field Scouting & Symptom Identification\n", " training_examples.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"What are the symptoms of {clean_name}? How do I identify it in the field?\",\n", " \"output\": f\"**Symptom Identification for {clean_name}:**\\n\\nLook for **{entry['symptoms']}**. If you observe these symptoms, act immediately: {entry['treatment']}\"\n", " })\n", " \n", " # 5. Hinglish Farmer Query Style\n", " training_examples.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"Khet me {clean_name} lag gaya hai, patto me {entry['symptoms']} dikh raha hai. Upay bataiye.\",\n", " \"output\": f\"**{clean_name} ka ilaaj:**\\n\\n- **Turant Upay (Immediate Treatment):** {entry['treatment']}\\n- **Organic Upay:** {entry['organic']}\\n- **Roka-thaam (Prevention):** {entry['prevention']}\"\n", " })\n", " \n", " # 6. Emergency Recovery / Yield Protection\n", " training_examples.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"Emergency: {clean_name} is spreading fast in my crop. How to stop it from ruining the entire harvest?\",\n", " \"output\": f\"**Emergency Intervention for {clean_name}:**\\n\\n1. **Stop the Spread:** {entry['treatment']}\\n2. **Field Hygiene:** {entry['prevention']}\\n3. **Eco Alternative:** {entry['organic']}\"\n", " })\n", " \n", " # 7. Low-Cost / Smallholder Farmer Scenario\n", " training_examples.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"I am a smallholder farmer with a low budget. What is the most cost-effective way to handle {clean_name}?\",\n", " \"output\": f\"**Cost-Effective Management for {clean_name}:**\\n\\n- **Low-Cost Method:** {entry['organic']}\\n- **Chemical Alternative if Severe:** {entry['treatment']}\\n- **Zero-Cost Cultural Control:** {entry['prevention']}\"\n", " })\n", "\n", "# Shuffle the final dataset\n", "random.seed(42)\n", "random.shuffle(training_examples)\n", "\n", "# Save both standard and expanded files\n", "with open('agriculture_training_data.json', 'w', encoding='utf-8') as f:\n", " json.dump(training_examples, f, indent=2, ensure_ascii=False)\n", "\n", "with open('agrivani_expanded_dataset.json', 'w', encoding='utf-8') as f:\n", " json.dump(training_examples, f, indent=2, ensure_ascii=False)\n", "\n", "print(f\"✅ Successfully generated {len(training_examples)} training examples in 'agriculture_training_data.json'!\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T10:07:02.403452Z", "iopub.status.busy": "2026-09-02T10:07:02.402805Z", "iopub.status.idle": "2026-09-02T10:07:02.415483Z", "shell.execute_reply": "2026-09-02T10:07:02.414789Z", "shell.execute_reply.started": "2026-09-02T10:07:02.403422Z" }, "trusted": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "✅ Generated 174 new agri-domain examples\n" ] } ], "source": [ "# Requires agri_knowledge_base already defined (from your original dataset script)\n", "\n", "new_templates = []\n", "\n", "for entry in agri_knowledge_base:\n", " clean_name = entry[\"class_name\"].replace(\"___\", \" - \").replace(\"_\", \" \")\n", "\n", " # 1. Yield/economic angle\n", " new_templates.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"Will {clean_name} reduce my crop yield significantly? Should I be worried?\",\n", " \"output\": f\"Yes, if left untreated, {clean_name} can significantly reduce yield and fruit/leaf quality. Acting early makes a big difference:\\n\\n- **Immediate step:** {entry['treatment']}\\n- **To protect future harvests:** {entry['prevention']}\"\n", " })\n", "\n", " # 2. Contagion/spread concern\n", " new_templates.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"Can {clean_name} spread to my neighbor's field or other crops nearby?\",\n", " \"output\": f\"This depends on the specific pathogen, but many diseases like this can spread via wind, rain splash, insects, or contaminated tools. It's worth informing nearby farmers.\\n\\n- **To limit spread:** {entry['prevention']}\\n- **If already spreading:** {entry['treatment']}\"\n", " })\n", "\n", " # 3. Timing / seasonal question\n", " new_templates.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"When is {clean_name} most likely to occur, and should I be checking for it right now?\",\n", " \"output\": f\"Watch for **{entry['symptoms']}** — catching it early makes treatment far more effective.\\n\\n- **If you see these signs:** {entry['treatment']}\\n- **To reduce future risk:** {entry['prevention']}\"\n", " })\n", "\n", " # 4. Short, casual Hinglish phrasing (different from earlier \"Khet me X lag gaya\" template)\n", " new_templates.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"{clean_name} ke baare mein thoda samjhaiye, kya karna chahiye?\",\n", " \"output\": f\"**{clean_name}** ke lakshan hain: {entry['symptoms']}\\n\\n**Kya karein:** {entry['treatment']}\\n\\n**Aage bachne ke liye:** {entry['prevention']}\"\n", " })\n", "\n", " # 5. Comparison of chemical vs organic decision\n", " new_templates.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"For {clean_name}, should I go with chemical treatment or organic — what's the difference?\",\n", " \"output\": f\"Both work, with trade-offs:\\n\\n- **Chemical (faster, more reliable in severe cases):** {entry['treatment']}\\n- **Organic (safer, better for long-term soil/plant health):** {entry['organic']}\\n\\nFor severe infections, many farmers start with the chemical option and shift to organic maintenance once under control.\"\n", " })\n", "\n", " # 6. Confirmation/second-opinion style question\n", " new_templates.append({\n", " \"instruction\": system_instruction,\n", " \"input\": f\"I think my crop has {clean_name} but I'm not 100% sure. What should I look for to confirm?\",\n", " \"output\": f\"To confirm, check for: **{entry['symptoms']}**\\n\\nIf you see these signs clearly, you can proceed with treatment: {entry['treatment']}. If symptoms don't match exactly, it may be worth getting a second opinion from a local agricultural officer before treating.\"\n", " })\n", "\n", "random.shuffle(new_templates)\n", "print(f\"✅ Generated {len(new_templates)} new agri-domain examples\")\n", "\n", "with open('agrivani_expanded_agri_data.json', 'w', encoding='utf-8') as f:\n", " json.dump(new_templates, f, indent=2, ensure_ascii=False)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T10:07:08.483005Z", "iopub.status.busy": "2026-09-02T10:07:08.482678Z", "iopub.status.idle": "2026-09-02T10:07:08.502495Z", "shell.execute_reply": "2026-09-02T10:07:08.501880Z", "shell.execute_reply.started": "2026-09-02T10:07:08.482921Z" }, "trusted": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Base conversational examples: 56\n", "✅ Final conversational dataset: 90 examples\n" ] } ], "source": [ "import json\n", "import random\n", "\n", "system_instruction = \"You are AgriVani, an expert agricultural advisor for Indian farmers. Provide clear, actionable, and empathetic farming advice in simple language.\"\n", "\n", "conversational_data = []\n", "\n", "# 1. Greetings (English + Hinglish)\n", "greetings = [\n", " (\"Hi\", \"Hello! I'm AgriVani, your farming assistant. How can I help you with your crops today?\"),\n", " (\"Hello\", \"Hi there! Tell me about your farm or crop issue, and I'll do my best to help.\"),\n", " (\"Namaste AgriVani\", \"Namaste! Main aapki fasal ki samasyaon mein madad karne ke liye yahan hoon. Bataiye kya poochna hai?\"),\n", " (\"Good morning\", \"Good morning! Hope your fields are doing well today. What can I help you with?\"),\n", " (\"Good evening, kaise ho?\", \"Namaste! Main theek hoon, aap bataiye — khet mein kuch samasya hai kya?\"),\n", " (\"Kya haal hai AgriVani?\", \"Sab badhiya! Aapke fasal ke baare mein kuch poochna hai kya?\"),\n", " (\"Hey\", \"Hey! What's going on with your crops today?\"),\n", " (\"Namaskar\", \"Namaskar! Kaise madad kar sakta hoon aapki?\"),\n", "]\n", "for q, a in greetings:\n", " conversational_data.append({\"instruction\": system_instruction, \"input\": q, \"output\": a})\n", "\n", "# 2. Capability / identity questions\n", "capability = [\n", " (\"What can you help me with?\", \"I can help diagnose crop diseases and pest problems, suggest treatments (both chemical and organic), give prevention tips, and answer general farming questions. Just tell me what's going on with your crop.\"),\n", " (\"Who are you?\", \"I'm AgriVani, an AI assistant built to help farmers identify and treat crop diseases and pests, and offer practical farming advice.\"),\n", " (\"Tum kya kar sakte ho?\", \"Main aapki fasal ki bimariyon aur keeton ki pehchaan karne mein, unka ilaj batane mein, aur roka-thaam ke tarike batane mein madad kar sakta hoon.\"),\n", " (\"Are you a real farmer?\", \"I'm not a farmer myself, but I've been trained on agricultural knowledge to help answer your farming questions as clearly as I can. For complex or unusual cases, I'd also recommend consulting your local agricultural extension officer.\"),\n", " (\"Can you tell me the weather?\", \"I don't have access to live weather data, but I can help you plan crop care around general weather patterns — like which diseases are more likely during monsoon or dry spells.\"),\n", " (\"Do you know about all crops?\", \"I have knowledge about common crops like apple, corn, grape, tomato, potato, and several others, especially their diseases and pests. If you tell me your crop, I'll do my best to help.\"),\n", "]\n", "for q, a in capability:\n", " conversational_data.append({\"instruction\": system_instruction, \"input\": q, \"output\": a})\n", "\n", "# 3. Gratitude / farewell\n", "gratitude = [\n", " (\"Thank you\", \"You're most welcome! Feel free to come back anytime you have a question about your crops.\"),\n", " (\"Thanks a lot AgriVani\", \"Happy to help! Good luck with your harvest.\"),\n", " (\"Dhanyavaad\", \"Aapka swagat hai! Jab bhi zaroorat ho, poochiye.\"),\n", " (\"Bahut madad mili, shukriya\", \"Khushi hui madad karke! Fasal achhi ho, yehi dua hai.\"),\n", " (\"Ok bye\", \"Take care, and all the best with your farming!\"),\n", " (\"Theek hai, phir milte hain\", \"Zaroor! Khushaal fasal ki shubhkamnayein.\"),\n", " (\"That was helpful, thanks\", \"Glad I could help! Let me know if anything else comes up.\"),\n", "]\n", "for q, a in gratitude:\n", " conversational_data.append({\"instruction\": system_instruction, \"input\": q, \"output\": a})\n", "\n", "# 4. Empathy for stress/frustration (important — farmers under real pressure)\n", "empathy = [\n", " (\"Mera pura fasal barbad ho gaya, kya karu?\", \"Yeh sunke bahut afsos hua. Pehle mujhe bataiye — kaunsi fasal hai aur patto/tano par kaisa nazar aa raha hai? Isse main sahi salaah de sakunga.\"),\n", " (\"I'm losing money because of this disease, please help fast\", \"I understand this is urgent and stressful. Tell me the crop and what you're seeing on the leaves or fruit, and I'll give you the fastest effective treatment option right away.\"),\n", " (\"This is the third year my crop has failed\", \"That's really tough to go through three years in a row. Let's figure out what's happening this time — what crop, and what symptoms are you seeing? We can also talk about prevention for next season.\"),\n", " (\"Mujhe kuch samajh nahi aa raha, sab kharab ho raha hai\", \"Ghabraiye mat, hum saath mein pata lagate hain. Mujhe thoda detail mein bataiye — kaunsi fasal hai, patto ka rang kaisa hai, aur kab se yeh dikh raha hai?\"),\n", " (\"I don't have much money to buy expensive pesticides\", \"That's completely understandable — many effective treatments don't need to be expensive. Tell me your crop and problem, and I'll prioritize low-cost or organic options for you.\"),\n", " (\"My father always managed the farm, I'm new to this\", \"Welcome to farming — it's a lot to take in at first, but you'll learn quickly. What's going on with your crop right now? I'll explain things step by step.\"),\n", "]\n", "for q, a in empathy:\n", " conversational_data.append({\"instruction\": system_instruction, \"input\": q, \"output\": a})\n", "\n", "# 5. Vague input needing clarification\n", "clarification = [\n", " (\"Mera paudha theek nahi hai\", \"Samajh gaya, lekin thoda aur bataiye — kaunsi fasal hai (jaise tamatar, aloo, seb), aur patto ya phal par kya dikh raha hai? Rang badal gaya hai, dhabbe hain, ya kuch aur?\"),\n", " (\"Something is wrong with my crop\", \"I'd like to help — could you tell me which crop it is, and describe what you're seeing? For example, spots on leaves, wilting, holes, or discoloration all point to different problems.\"),\n", " (\"Leaves are looking bad\", \"Got it — which crop are we talking about, and can you describe the leaves a bit more? Are there spots, a powdery coating, yellowing, curling, or holes?\"),\n", " (\"Kya karu meri fasal ke liye?\", \"Zaroor madad karunga — pehle yeh bataiye ki kaunsi fasal hai aur uspe kya samasya dikh rahi hai?\"),\n", " (\"Help me with pests\", \"Sure — which crop is affected, and what kind of damage are you seeing? Holes in leaves, chewed edges, or insects you can actually see on the plant?\"),\n", "]\n", "for q, a in clarification:\n", " conversational_data.append({\"instruction\": system_instruction, \"input\": q, \"output\": a})\n", "\n", "# 6. Off-topic redirect (politely stay in domain, but don't refuse rudely)\n", "off_topic = [\n", " (\"What's the capital of India?\", \"That's outside what I specialize in — I'm here to help with crop diseases, pests, and farming advice. Is there something about your crops I can help with?\"),\n", " (\"Tell me a joke\", \"I'll stick to farming advice for now, but I appreciate the fun request! If you've got a crop question, I'm all ears.\"),\n", " (\"What's the stock market doing today?\", \"I don't track market data, but if you're wondering about crop pricing decisions related to disease-damaged yield, I might be able to help think that through.\"),\n", " (\"Can you write me a poem?\", \"That's not really my specialty — I'm focused on helping with your farming questions. What's going on with your crops?\"),\n", "]\n", "for q, a in off_topic:\n", " conversational_data.append({\"instruction\": system_instruction, \"input\": q, \"output\": a})\n", "\n", "# 7. Feedback / correction handling\n", "feedback = [\n", " (\"That advice didn't work for me\", \"I'm sorry to hear that. Can you tell me what you tried and what happened? That'll help me suggest a better next step.\"),\n", " (\"Aapne jo bataya woh kaam nahi kiya\", \"Maaf kijiye, mujhe bataiye aapne kya try kiya tha aur result kya raha — main better solution dhoondne mein madad karunga.\"),\n", " (\"You're wrong about this\", \"Thanks for pointing that out — agriculture can vary a lot by region and conditions. Can you tell me more about what you're seeing so I can give better advice?\"),\n", " (\"That was really helpful advice\", \"I'm glad it helped! Let me know how it goes, and feel free to ask if anything changes.\"),\n", "]\n", "for q, a in feedback:\n", " conversational_data.append({\"instruction\": system_instruction, \"input\": q, \"output\": a})\n", "\n", "# 8. General farming context questions (not disease-specific)\n", "general_farming = [\n", " (\"Best time to plant tomatoes in North India?\", \"In North India, tomatoes are typically planted in two seasons: October-November (winter crop) and June-July (monsoon crop). Choose based on your region's climate and irrigation availability.\"),\n", " (\"How much water does wheat need?\", \"Wheat generally needs 4-6 irrigations depending on soil and climate — critical stages are crown root initiation, tillering, flowering, and grain filling. Avoid waterlogging.\"),\n", " (\"Kaunsi fasal kam paani mein achhi hoti hai?\", \"Bajra, jowar, moong, aur til jaisi fasalein kam paani mein bhi achhi ugti hain — yeh sookhe ilaakon ke liye behtar vikalp hain.\"),\n", " (\"What is crop rotation and why does it matter?\", \"Crop rotation means growing different types of crops in the same field across seasons. It helps break pest and disease cycles, improves soil fertility, and reduces the buildup of soil-borne pathogens.\"),\n", " (\"How do I test my soil?\", \"You can get a soil testing kit from your local agricultural extension office, or send a sample to a government soil testing lab. It'll tell you pH, nutrient levels (N-P-K), and organic matter content.\"),\n", " (\"Organic vs chemical fertilizer, which is better?\", \"Both have their place. Organic fertilizers (compost, vermicompost, FYM) improve long-term soil health and are budget-friendly if you produce your own. Chemical fertilizers act faster but need careful dosing to avoid soil degradation over time. Many farmers use a combination.\"),\n", "]\n", "for q, a in general_farming:\n", " conversational_data.append({\"instruction\": system_instruction, \"input\": q, \"output\": a})\n", "\n", "# 9. Follow-up conversational patterns\n", "followups = [\n", " (\"Ok, and how long will it take to see results?\", \"Most fungicide/bactericide treatments show visible improvement within 7-10 days if applied correctly and weather cooperates. Organic treatments may take slightly longer — usually 10-14 days.\"),\n", " (\"Is this safe for my animals?\", \"Most recommended treatments are safe once dried on the plant, but keep animals away during and right after spraying, and always follow the label's re-entry interval if using chemical products.\"),\n", " (\"Can I mix this with other pesticides?\", \"It's best not to mix products unless the label specifically confirms compatibility — mixing incompatible chemicals can reduce effectiveness or harm the crop. When in doubt, apply them a few days apart.\"),\n", " (\"How often should I spray?\", \"This depends on the specific product and disease severity, but a common approach is every 7-10 days during active disease pressure, then reducing frequency as symptoms improve.\"),\n", " (\"Will this affect my yield this season?\", \"Early treatment usually limits yield loss significantly. The sooner you act, the better your chances of protecting most of this season's harvest.\"),\n", "]\n", "for q, a in followups:\n", " conversational_data.append({\"instruction\": system_instruction, \"input\": q, \"output\": a})\n", "\n", "# 10. Extra Hinglish variety round (greetings/capability blended for volume + realism)\n", "extra_hinglish = [\n", " (\"Aap mujhe seb ke baare mein bata sakte ho?\", \"Bilkul! Seb (apple) mein aksar Apple Scab, Black Rot, ya Cedar Apple Rust jaisi bimariyan hoti hain. Aapko kya dikh raha hai apne ped mein?\"),\n", " (\"Mera makka (corn) kharab ho raha hai\", \"Samajh gaya — makke mein Common Rust, Northern Leaf Blight, ya Gray Leaf Spot jaisi samasyayein aam hain. Patto par kaisa nishaan dikh raha hai?\"),\n", " (\"Angoor ke bagiche mein samasya hai\", \"Angoor mein Black Rot, Esca, ya Leaf Blight ho sakta hai. Kya aap bata sakte hain patto ya phal par kya dikh raha hai?\"),\n", " (\"Santre ke ped peele pad rahe hain\", \"Yeh Citrus Greening (Huanglongbing) ka lakshan ho sakta hai — yeh ek gambhir bimari hai jiska koi ilaj nahi hai, lekin ussey failne se roka ja sakta hai. Kya patte assymetric roop se peele hain?\"),\n", " (\"Aaloo mein kuch dikh raha hai patto par\", \"Samajh gaya — aaloo mein Early Blight ya Late Blight ho sakta hai. Kya dhabbe gol hain concentric rings ke saath, ya paani-bhare hue dikh rahe hain?\"),\n", "]\n", "for q, a in extra_hinglish:\n", " conversational_data.append({\"instruction\": system_instruction, \"input\": q, \"output\": a})\n", "\n", "print(f\"Base conversational examples: {len(conversational_data)}\")\n", "\n", "# --- Augmentation pass: light rephrasing to expand coverage past 120+ ---\n", "openers_en = [\"\", \"Quick question — \", \"Just wondering, \", \"Can you tell me, \"]\n", "closers_en = [\"\", \" Please guide me.\", \" Thanks in advance.\", \" Let me know.\"]\n", "\n", "augmented = []\n", "for item in conversational_data:\n", " if random.random() < 0.55: # augment ~55% of entries to add volume without over-duplicating\n", " opener = random.choice(openers_en)\n", " closer = random.choice(closers_en)\n", " new_input = f\"{opener}{item['input'][0].lower() + item['input'][1:] if opener else item['input']}{closer}\"\n", " augmented.append({\"instruction\": system_instruction, \"input\": new_input, \"output\": item[\"output\"]})\n", "\n", "conversational_data.extend(augmented)\n", "random.shuffle(conversational_data)\n", "print(f\"✅ Final conversational dataset: {len(conversational_data)} examples\")\n", "\n", "with open('agrivani_conversational_data.json', 'w', encoding='utf-8') as f:\n", " json.dump(conversational_data, f, indent=2, ensure_ascii=False)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T10:07:15.980250Z", "iopub.status.busy": "2026-09-02T10:07:15.979877Z", "iopub.status.idle": "2026-09-02T10:07:15.996007Z", "shell.execute_reply": "2026-09-02T10:07:15.995081Z", "shell.execute_reply.started": "2026-09-02T10:07:15.980225Z" }, "trusted": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "✅ Final combined dataset: 467 examples\n", " - Original agri: 203\n", " - Expanded agri: 174\n", " - Conversational: 90\n" ] } ], "source": [ "import json, random\n", "\n", "with open('agriculture_training_data.json') as f:\n", " original_agri = json.load(f)\n", "with open('agrivani_expanded_agri_data.json') as f:\n", " expanded_agri = json.load(f)\n", "with open('agrivani_conversational_data.json') as f:\n", " conversational = json.load(f)\n", "\n", "combined = original_agri + expanded_agri + conversational\n", "random.shuffle(combined)\n", "\n", "with open('agrivani_final_training_data.json', 'w', encoding='utf-8') as f:\n", " json.dump(combined, f, indent=2, ensure_ascii=False)\n", "\n", "print(f\"✅ Final combined dataset: {len(combined)} examples\")\n", "print(f\" - Original agri: {len(original_agri)}\")\n", "print(f\" - Expanded agri: {len(expanded_agri)}\")\n", "print(f\" - Conversational: {len(conversational)}\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T10:07:21.970191Z", "iopub.status.busy": "2026-09-02T10:07:21.969326Z", "iopub.status.idle": "2026-09-02T10:07:26.657831Z", "shell.execute_reply": "2026-09-02T10:07:26.657116Z", "shell.execute_reply.started": "2026-09-02T10:07:21.970160Z" }, "trusted": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Visible GPU count: 1\n" ] } ], "source": [ "import os\n", "os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"\n", "\n", "import torch\n", "print(f\"Visible GPU count: {torch.cuda.device_count()}\") # should now print 1" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T10:07:40.647484Z", "iopub.status.busy": "2026-09-02T10:07:40.647098Z", "iopub.status.idle": "2026-09-02T11:08:10.159318Z", "shell.execute_reply": "2026-09-02T11:08:10.158640Z", "shell.execute_reply.started": "2026-09-02T10:07:40.647460Z" }, "trusted": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Skipping import of cpp extensions due to incompatible torch version. Please upgrade to torch >= 2.11.0 (found 2.10.0+cu128).\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "--- GEMMA 2B-IT QLORA FINE-TUNING START ---\n", "Dataset size: 467 examples\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5bb555d8443d46b08c6cc492d49149c4", "version_major": 2, "version_minor": 0 }, "text/plain": [ "config.json: 0%| | 0.00/627 [00:00\n", " \n", " \n", " [295/295 59:16, Epoch 5/5]\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
StepTraining Loss
54.553101
104.322716
154.555563
204.363247
254.431360
304.363453
354.369994
404.460134
454.410031
504.423763
554.532228
604.500361
654.430378
704.460595
754.560879
804.505497
854.414101
904.439880
954.400496
1004.333587
1054.334829
1104.445845
1154.457384
1204.374336
1254.478313
1304.326891
1354.243887
1404.373573
1454.594180
1504.458669
1554.558271
1604.499374
1654.453758
1704.421059
1754.480963
1804.445738
1854.351519
1904.453698
1954.342197
2004.525570
2054.511033
2104.426330
2154.482001
2204.293271
2254.513672
2304.417222
2354.451628
2404.382831
2454.423153
2504.394794
2554.397120
2604.380727
2654.468753
2704.439137
2754.341325
2804.573659
2854.464004
2904.499251
2954.485838

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "✅ Training complete!\n" ] }, { "data": { "text/plain": [ "('agrivani_gemma_2b_lora/tokenizer_config.json',\n", " 'agrivani_gemma_2b_lora/chat_template.jinja',\n", " 'agrivani_gemma_2b_lora/tokenizer.json')" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import os\n", "os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"\n", "\n", "import torch\n", "import json\n", "from datasets import Dataset\n", "from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig\n", "from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training\n", "from trl import SFTTrainer, SFTConfig\n", "\n", "print(\"--- GEMMA 2B-IT QLORA FINE-TUNING START ---\")\n", "\n", "with open('agrivani_final_training_data.json') as f:\n", " train_data = json.load(f)\n", "\n", "dataset = Dataset.from_dict({\n", " 'text': [f\"Instruction: {ex['instruction']}\\n\\nInput: {ex['input']}\\n\\nOutput: {ex['output']}\"\n", " for ex in train_data]\n", "})\n", "print(f\"Dataset size: {len(dataset)} examples\")\n", "\n", "model_id = \"google/gemma-2b-it\"\n", "tokenizer = AutoTokenizer.from_pretrained(model_id)\n", "tokenizer.pad_token = tokenizer.eos_token\n", "\n", "bnb_config = BitsAndBytesConfig(\n", " load_in_4bit=True,\n", " bnb_4bit_quant_type=\"nf4\",\n", " bnb_4bit_use_double_quant=True,\n", " bnb_4bit_compute_dtype=torch.bfloat16\n", ")\n", "\n", "model = AutoModelForCausalLM.from_pretrained(\n", " model_id,\n", " quantization_config=bnb_config,\n", " device_map={\"\": 0}\n", ")\n", "model = prepare_model_for_kbit_training(model)\n", "\n", "lora_config = LoraConfig(\n", " r=16,\n", " lora_alpha=32,\n", " target_modules=[\"q_proj\", \"k_proj\", \"v_proj\", \"o_proj\", \"gate_proj\", \"up_proj\", \"down_proj\"],\n", " lora_dropout=0.05,\n", " bias=\"none\",\n", " task_type=\"CAUSAL_LM\"\n", ")\n", "model = get_peft_model(model, lora_config)\n", "model.print_trainable_parameters()\n", "\n", "training_args = SFTConfig(\n", " output_dir=\"./agrivani_gemma_ft\",\n", " num_train_epochs=5,\n", " per_device_train_batch_size=2,\n", " gradient_accumulation_steps=4,\n", " warmup_steps=10,\n", " learning_rate=2e-4,\n", " lr_scheduler_type=\"constant\",\n", " logging_steps=5,\n", " save_steps=50,\n", " save_total_limit=2,\n", " seed=42,\n", " dataset_text_field=\"text\",\n", " bf16=True,\n", ")\n", "\n", "trainer = SFTTrainer(\n", " model=model,\n", " processing_class=tokenizer,\n", " train_dataset=dataset,\n", " args=training_args\n", ")\n", "\n", "print(\"Starting training...\")\n", "trainer.train()\n", "print(\"✅ Training complete!\")\n", "\n", "model.save_pretrained(\"agrivani_gemma_2b_lora\")\n", "tokenizer.save_pretrained(\"agrivani_gemma_2b_lora\")" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T11:08:59.512758Z", "iopub.status.busy": "2026-09-02T11:08:59.512013Z", "iopub.status.idle": "2026-09-02T11:09:16.822158Z", "shell.execute_reply": "2026-09-02T11:09:16.821486Z", "shell.execute_reply.started": "2026-09-02T11:08:59.512723Z" }, "trusted": true }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3d314296b85e46828082401a18228b95", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Loading weights: 0%| | 0/164 [00:00=2.30.0, which is not installed.\n", "google-adk 1.29.0 requires google-cloud-bigquery-storage>=2.0.0, which is not installed.\n", "grpcio-tools 1.71.2 requires protobuf<6.0dev,>=5.26.1, but you have protobuf 4.25.9 which is incompatible.\n", "kaggle-environments 1.29.3 requires numpy>=2.0, but you have numpy 1.26.4 which is incompatible.\n", "litellm 1.82.4 requires aiohttp>=3.10, but you have aiohttp 3.9.5 which is incompatible.\n", "cesium 0.12.4 requires numpy<3.0,>=2.0, but you have numpy 1.26.4 which is incompatible.\n", "a2a-sdk 0.3.26 requires protobuf>=5.29.5, but you have protobuf 4.25.9 which is incompatible.\n", "google-colab 1.0.0 requires jupyter-server==2.14.0, but you have jupyter-server 2.12.5 which is incompatible.\n", "google-colab 1.0.0 requires pandas==2.2.2, but you have pandas 2.2.3 which is incompatible.\n", "dopamine-rl 4.1.2 requires gym<=0.25.2, but you have gym 0.26.2 which is incompatible.\n", "tensorflow 2.20.0 requires protobuf>=5.28.0, but you have protobuf 4.25.9 which is incompatible.\n", "jaxlib 0.7.2 requires numpy>=2.0, but you have numpy 1.26.4 which is incompatible.\n", "cupy-cuda12x 14.0.1 requires numpy<2.6,>=2.0, but you have numpy 1.26.4 which is incompatible.\n", "moviepy 1.0.3 requires decorator<5.0,>=4.0.2, but you have decorator 5.3.1 which is incompatible.\n", "opencv-python 4.13.0.92 requires numpy>=2; python_version >= \"3.9\", but you have numpy 1.26.4 which is incompatible.\n", "tobler 0.14.0 requires numpy>=2.0, but you have numpy 1.26.4 which is incompatible.\n", "ydf 0.15.0 requires protobuf<7.0.0,>=5.29.1, but you have protobuf 4.25.9 which is incompatible.\n", "jax 0.7.2 requires numpy>=2.0, but you have numpy 1.26.4 which is incompatible.\n", "opencv-python-headless 4.13.0.92 requires numpy>=2; python_version >= \"3.9\", but you have numpy 1.26.4 which is incompatible.\n", "torchaudio 2.10.0+cu128 requires torch==2.10.0, but you have torch 2.11.0+cpu which is incompatible.\n", "rasterio 1.5.0 requires numpy>=2, but you have numpy 1.26.4 which is incompatible.\n", "torchvision 0.25.0+cu128 requires torch==2.10.0, but you have torch 2.11.0+cpu which is incompatible.\n", "pytensor 2.38.2 requires numpy>=2.0, but you have numpy 1.26.4 which is incompatible.\n", "xarray-einstats 0.10.0 requires numpy>=2.0, but you have numpy 1.26.4 which is incompatible.\n", "tifffile 2026.4.11 requires numpy>=2.0, but you have numpy 1.26.4 which is incompatible.\n", "opencv-contrib-python 4.13.0.92 requires numpy>=2; python_version >= \"3.9\", but you have numpy 1.26.4 which is incompatible.\n", "opentelemetry-proto 1.38.0 requires protobuf<7.0,>=5.0, but you have protobuf 4.25.9 which is incompatible.\n", "grain 0.2.16 requires protobuf>=5.28.3, but you have protobuf 4.25.9 which is incompatible.\n", "grpcio-status 1.71.2 requires protobuf<6.0dev,>=5.26.1, but you have protobuf 4.25.9 which is incompatible.\n", "shap 0.51.0 requires numpy>=2, but you have numpy 1.26.4 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mINFO:hf-to-gguf:Loading model: agrivani_gemma_2b_merged\n", "INFO:hf-to-gguf:Model architecture: GemmaForCausalLM\n", "INFO:hf-to-gguf:gguf: indexing model part 'model.safetensors'\n", "INFO:gguf.gguf_writer:gguf: This GGUF file is for Little Endian only\n", "INFO:hf-to-gguf:Exporting model...\n", "INFO:hf-to-gguf:token_embd.weight, torch.float16 --> F16, shape = {2048, 256000}\n", "INFO:hf-to-gguf:blk.0.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.0.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.0.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.0.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.0.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.0.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.0.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.0.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.0.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.1.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.1.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.1.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.1.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.1.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.1.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.1.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.1.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.1.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.10.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.10.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.10.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.10.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.10.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.10.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.10.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.10.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.10.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.11.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.11.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.11.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.11.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.11.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.11.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.11.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.11.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.11.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.12.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.12.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.12.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.12.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.12.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.12.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.12.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.12.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.12.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.13.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.13.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.13.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.13.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.13.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.13.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.13.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.13.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.13.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.14.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.14.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.14.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.14.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.14.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.14.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.14.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.14.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.14.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.15.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.15.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.15.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.15.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.15.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.15.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.15.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.15.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.15.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.16.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.16.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.16.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.16.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.16.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.16.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.16.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.16.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.16.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.17.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.17.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.17.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.17.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.17.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.17.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.17.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.17.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.17.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.2.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.2.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.2.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.2.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.2.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.2.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.2.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.2.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.2.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.3.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.3.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.3.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.3.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.3.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.3.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.3.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.3.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.3.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.4.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.4.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.4.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.4.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.4.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.4.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.4.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.4.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.4.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.5.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.5.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.5.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.5.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.5.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.5.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.5.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.5.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.5.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.6.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.6.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.6.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.6.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.6.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.6.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.6.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.6.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.6.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.7.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.7.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.7.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.7.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.7.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.7.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.7.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.7.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.7.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.8.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.8.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.8.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.8.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.8.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.8.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.8.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.8.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.8.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.9.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.9.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.9.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.9.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.9.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.9.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.9.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.9.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.9.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:output_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:Set meta model\n", "INFO:hf-to-gguf:Set model parameters\n", "INFO:hf-to-gguf:Set model quantization version\n", "INFO:hf-to-gguf:Set model tokenizer\n", "Traceback (most recent call last):\n", " File \"/kaggle/working/llama.cpp/convert_hf_to_gguf.py\", line 307, in \n", " main()\n", " File \"/kaggle/working/llama.cpp/convert_hf_to_gguf.py\", line 301, in main\n", " model_instance.write()\n", " File \"/kaggle/working/llama.cpp/conversion/base.py\", line 1073, in write\n", " self.prepare_metadata(vocab_only=False)\n", " File \"/kaggle/working/llama.cpp/conversion/base.py\", line 1270, in prepare_metadata\n", " self.set_vocab()\n", " File \"/kaggle/working/llama.cpp/conversion/gemma.py\", line 23, in set_vocab\n", " self._set_vocab_sentencepiece()\n", " File \"/kaggle/working/llama.cpp/conversion/base.py\", line 1908, in _set_vocab_sentencepiece\n", " tokens, scores, toktypes = self._create_vocab_sentencepiece()\n", " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", " File \"/kaggle/working/llama.cpp/conversion/base.py\", line 1925, in _create_vocab_sentencepiece\n", " raise FileNotFoundError(f\"File not found: {tokenizer_path}\")\n", "FileNotFoundError: File not found: agrivani_gemma_2b_merged/tokenizer.model\n", "-- The C compiler identification is GNU 11.4.0\n", "-- The CXX compiler identification is GNU 11.4.0\n", "-- Detecting C compiler ABI info\n", "-- Detecting C compiler ABI info - done\n", "-- Check for working C compiler: /usr/bin/cc - skipped\n", "-- Detecting C compile features\n", "-- Detecting C compile features - done\n", "-- Detecting CXX compiler ABI info\n", "-- Detecting CXX compiler ABI info - done\n", "-- Check for working CXX compiler: /usr/bin/c++ - skipped\n", "-- Detecting CXX compile features\n", "-- Detecting CXX compile features - done\n", "-- llama.cpp version: 0.3.0-dev\n", "\u001b[0mCMAKE_BUILD_TYPE=Release\u001b[0m\n", "-- Found Git: /usr/bin/git (found version \"2.34.1\")\n", "-- The ASM compiler identification is GNU\n", "-- Found assembler: /usr/bin/cc\n", "-- Performing Test CMAKE_HAVE_LIBC_PTHREAD\n", "-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success\n", "-- Found Threads: TRUE\n", "-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF\n", "-- CMAKE_SYSTEM_PROCESSOR: x86_64\n", "-- GGML_SYSTEM_ARCH: x86\n", "-- Found OpenMP_C: -fopenmp (found version \"4.5\")\n", "-- Found OpenMP_CXX: -fopenmp (found version \"4.5\")\n", "-- Found OpenMP: TRUE (found version \"4.5\")\n", "-- Including CPU backend\n", "-- x86 detected\n", "-- Adding CPU backend variant ggml-cpu: -march=native \n", "-- ggml version: 0.22.0\n", "-- ggml commit: 0f3a71be1\n", "-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version \"3.0.2\")\n", "-- Performing Test OPENSSL_VERSION_SUPPORTED\n", "-- Performing Test OPENSSL_VERSION_SUPPORTED - Success\n", "-- OpenSSL found: 3.0.2\n", "-- Generating embedded license file for target: llama-app\n", "-- Configuring done (2.1s)\n", "-- Generating done (0.4s)\n", "-- Build files have been written to: /kaggle/working/llama.cpp/build\n", "[ 0%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common-base.dir/build-info.cpp.o\u001b[0m\n", "[ 0%] \u001b[32mBuilding CXX object vendor/cpp-httplib/CMakeFiles/cpp-httplib.dir/httplib.cpp.o\u001b[0m\n", "[ 2%] \u001b[32mBuilding C object ggml/src/CMakeFiles/ggml-base.dir/ggml.c.o\u001b[0m\n", "[ 2%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml.cpp.o\u001b[0m\n", "[ 2%] \u001b[32mBuilding C object ggml/src/CMakeFiles/ggml-base.dir/ggml-alloc.c.o\u001b[0m\n", "[ 2%] \u001b[32m\u001b[1mLinking CXX static library libllama-common-base.a\u001b[0m\n", "[ 2%] Built target llama-common-base\n", "[ 2%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-backend.cpp.o\u001b[0m\n", "[ 2%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-backend-meta.cpp.o\u001b[0m\n", "[ 4%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-opt.cpp.o\u001b[0m\n", "[ 4%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-threading.cpp.o\u001b[0m\n", "[ 4%] \u001b[32mBuilding C object ggml/src/CMakeFiles/ggml-base.dir/ggml-quants.c.o\u001b[0m\n", "[ 4%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-base.dir/gguf.cpp.o\u001b[0m\n", "[ 4%] \u001b[32m\u001b[1mLinking CXX shared library ../../bin/libggml-base.so\u001b[0m\n", "[ 4%] Built target ggml-base\n", "[ 4%] \u001b[32mBuilding C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu.c.o\u001b[0m\n", "[ 6%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu.cpp.o\u001b[0m\n", "[ 6%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/repack.cpp.o\u001b[0m\n", "[ 6%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/iqp.cpp.o\u001b[0m\n", "[ 6%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/hbm.cpp.o\u001b[0m\n", "[ 6%] \u001b[32mBuilding C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/quants.c.o\u001b[0m\n", "[ 8%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/traits.cpp.o\u001b[0m\n", "[ 8%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/amx/amx.cpp.o\u001b[0m\n", "[ 8%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/amx/mmq.cpp.o\u001b[0m\n", "[ 8%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/binary-ops.cpp.o\u001b[0m\n", "[ 8%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/unary-ops.cpp.o\u001b[0m\n", "[ 8%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/vec.cpp.o\u001b[0m\n", "[ 10%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ops.cpp.o\u001b[0m\n", "[ 10%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/llamafile/sgemm.cpp.o\u001b[0m\n", "[ 10%] \u001b[32mBuilding C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/arch/x86/quants.c.o\u001b[0m\n", "[ 10%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/arch/x86/repack.cpp.o\u001b[0m\n", "[ 10%] \u001b[32m\u001b[1mLinking CXX static library libcpp-httplib.a\u001b[0m\n", "[ 10%] Built target cpp-httplib\n", "[ 10%] \u001b[32m\u001b[1mLinking CXX shared library ../../bin/libggml-cpu.so\u001b[0m\n", "[ 10%] Built target ggml-cpu\n", "[ 10%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml.dir/ggml-backend-dl.cpp.o\u001b[0m\n", "[ 10%] \u001b[32mBuilding CXX object ggml/src/CMakeFiles/ggml.dir/ggml-backend-reg.cpp.o\u001b[0m\n", "[ 10%] \u001b[32m\u001b[1mLinking CXX shared library ../../bin/libggml.so\u001b[0m\n", "[ 10%] Built target ggml\n", "[ 10%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama.cpp.o\u001b[0m\n", "[ 10%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-adapter.cpp.o\u001b[0m\n", "[ 10%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-arch.cpp.o\u001b[0m\n", "[ 10%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-batch.cpp.o\u001b[0m\n", "[ 13%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-chat.cpp.o\u001b[0m\n", "[ 13%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-context.cpp.o\u001b[0m\n", "[ 13%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-cparams.cpp.o\u001b[0m\n", "[ 13%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-grammar.cpp.o\u001b[0m\n", "[ 13%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-graph.cpp.o\u001b[0m\n", "[ 15%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-hparams.cpp.o\u001b[0m\n", "[ 15%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-impl.cpp.o\u001b[0m\n", "[ 15%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-io.cpp.o\u001b[0m\n", "[ 15%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-kv-cache.cpp.o\u001b[0m\n", "[ 15%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-kv-cache-iswa.cpp.o\u001b[0m\n", "[ 17%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-kv-cache-dsa.cpp.o\u001b[0m\n", "[ 17%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-kv-cache-dsa-iswa.cpp.o\u001b[0m\n", "[ 17%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-kv-cache-msa.cpp.o\u001b[0m\n", "[ 17%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-kv-cache-dsv4.cpp.o\u001b[0m\n", "[ 17%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-memory.cpp.o\u001b[0m\n", "[ 17%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-memory-hybrid.cpp.o\u001b[0m\n", "[ 19%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-memory-hybrid-iswa.cpp.o\u001b[0m\n", "[ 19%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-memory-hybrid-idx.cpp.o\u001b[0m\n", "[ 19%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-memory-recurrent.cpp.o\u001b[0m\n", "[ 19%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-mmap.cpp.o\u001b[0m\n", "[ 19%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-model-loader.cpp.o\u001b[0m\n", "[ 21%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-model-saver.cpp.o\u001b[0m\n", "[ 21%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-model.cpp.o\u001b[0m\n", "[ 21%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-quant.cpp.o\u001b[0m\n", "[ 21%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-sampler.cpp.o\u001b[0m\n", "[ 21%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/llama-vocab.cpp.o\u001b[0m\n", "[ 21%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/unicode-data.cpp.o\u001b[0m\n", "[ 23%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/unicode.cpp.o\u001b[0m\n", "[ 23%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/afmoe.cpp.o\u001b[0m\n", "[ 23%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/apertus.cpp.o\u001b[0m\n", "[ 23%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/arcee.cpp.o\u001b[0m\n", "[ 23%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/arctic.cpp.o\u001b[0m\n", "[ 26%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/arwkv7.cpp.o\u001b[0m\n", "[ 26%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/baichuan.cpp.o\u001b[0m\n", "[ 26%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/bailingmoe.cpp.o\u001b[0m\n", "[ 26%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/bailingmoe2.cpp.o\u001b[0m\n", "[ 26%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/bailingmoe3.cpp.o\u001b[0m\n", "[ 26%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/bert.cpp.o\u001b[0m\n", "[ 28%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/bitnet.cpp.o\u001b[0m\n", "[ 28%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/bloom.cpp.o\u001b[0m\n", "[ 28%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/chameleon.cpp.o\u001b[0m\n", "[ 28%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/chatglm.cpp.o\u001b[0m\n", "[ 28%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/clip.cpp.o\u001b[0m\n", "[ 30%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/codeshell.cpp.o\u001b[0m\n", "[ 30%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/cogvlm.cpp.o\u001b[0m\n", "[ 30%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/cohere2.cpp.o\u001b[0m\n", "[ 30%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/cohere2moe.cpp.o\u001b[0m\n", "[ 30%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/command-r.cpp.o\u001b[0m\n", "[ 32%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/dbrx.cpp.o\u001b[0m\n", "[ 32%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/deci.cpp.o\u001b[0m\n", "[ 32%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/deepseek.cpp.o\u001b[0m\n", "[ 32%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/deepseek2.cpp.o\u001b[0m\n", "[ 32%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/deepseek2ocr.cpp.o\u001b[0m\n", "[ 32%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/deepseek32.cpp.o\u001b[0m\n", "[ 34%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/deepseek4.cpp.o\u001b[0m\n", "[ 34%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/delta-net-base.cpp.o\u001b[0m\n", "[ 34%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/dflash.cpp.o\u001b[0m\n", "[ 34%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/dots1.cpp.o\u001b[0m\n", "[ 34%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/dots3note.cpp.o\u001b[0m\n", "[ 36%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/dream.cpp.o\u001b[0m\n", "[ 36%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/eagle3.cpp.o\u001b[0m\n", "[ 36%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/ernie4-5-moe.cpp.o\u001b[0m\n", "[ 36%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/ernie4-5.cpp.o\u001b[0m\n", "[ 36%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/eurobert.cpp.o\u001b[0m\n", "[ 36%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/exaone-moe.cpp.o\u001b[0m\n", "[ 39%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/exaone.cpp.o\u001b[0m\n", "[ 39%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/exaone4.cpp.o\u001b[0m\n", "[ 39%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/falcon-h1.cpp.o\u001b[0m\n", "[ 39%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/falcon.cpp.o\u001b[0m\n", "[ 39%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/gemma-embedding.cpp.o\u001b[0m\n", "[ 41%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/gemma.cpp.o\u001b[0m\n", "[ 41%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/gemma2.cpp.o\u001b[0m\n", "[ 41%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/gemma3.cpp.o\u001b[0m\n", "[ 41%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/gemma3n.cpp.o\u001b[0m\n", "[ 41%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/gemma4-assistant.cpp.o\u001b[0m\n", "[ 41%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/gemma4.cpp.o\u001b[0m\n", "[ 43%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/glm-dsa.cpp.o\u001b[0m\n", "[ 43%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/glm4-moe.cpp.o\u001b[0m\n", "[ 43%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/glm4.cpp.o\u001b[0m\n", "[ 43%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/gpt2.cpp.o\u001b[0m\n", "[ 43%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/gptneox.cpp.o\u001b[0m\n", "[ 45%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/granite-hybrid.cpp.o\u001b[0m\n", "[ 45%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/granite-moe.cpp.o\u001b[0m\n", "[ 45%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/granite-swa.cpp.o\u001b[0m\n", "[ 45%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/granite-switch.cpp.o\u001b[0m\n", "[ 45%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/granite.cpp.o\u001b[0m\n", "[ 47%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/grok.cpp.o\u001b[0m\n", "[ 47%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/grovemoe.cpp.o\u001b[0m\n", "[ 47%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/hunyuan-dense.cpp.o\u001b[0m\n", "[ 47%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/hunyuan-moe.cpp.o\u001b[0m\n", "[ 47%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/hunyuan-vl.cpp.o\u001b[0m\n", "[ 47%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/hy-v3.cpp.o\u001b[0m\n", "[ 50%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/internlm2.cpp.o\u001b[0m\n", "[ 50%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/jais.cpp.o\u001b[0m\n", "[ 50%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/jais2.cpp.o\u001b[0m\n", "[ 50%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/jamba.cpp.o\u001b[0m\n", "[ 50%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/jina-bert-v2.cpp.o\u001b[0m\n", "[ 52%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/jina-bert-v3.cpp.o\u001b[0m\n", "[ 52%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/kimi-k3.cpp.o\u001b[0m\n", "[ 52%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/kimi-linear.cpp.o\u001b[0m\n", "[ 52%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/laguna.cpp.o\u001b[0m\n", "[ 52%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/lfm2.cpp.o\u001b[0m\n", "[ 52%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/lfm2moe.cpp.o\u001b[0m\n", "[ 54%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/llada-moe.cpp.o\u001b[0m\n", "[ 54%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/llada.cpp.o\u001b[0m\n", "[ 54%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/llama-embed.cpp.o\u001b[0m\n", "[ 54%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/llama.cpp.o\u001b[0m\n", "[ 54%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/llama4.cpp.o\u001b[0m\n", "[ 56%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/maincoder.cpp.o\u001b[0m\n", "[ 56%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/mamba-base.cpp.o\u001b[0m\n", "[ 56%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/mamba.cpp.o\u001b[0m\n", "[ 56%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/mamba2.cpp.o\u001b[0m\n", "[ 56%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/mellum.cpp.o\u001b[0m\n", "[ 56%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/mimo2.cpp.o\u001b[0m\n", "[ 58%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/minicpm.cpp.o\u001b[0m\n", "[ 58%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/minicpm3.cpp.o\u001b[0m\n", "[ 58%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/minimax-01.cpp.o\u001b[0m\n", "[ 58%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/minimax-m2.cpp.o\u001b[0m\n", "[ 58%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/minimax-m3.cpp.o\u001b[0m\n", "[ 60%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/mistral3.cpp.o\u001b[0m\n", "[ 60%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/mistral4.cpp.o\u001b[0m\n", "[ 60%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/modern-bert.cpp.o\u001b[0m\n", "[ 60%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/mpt.cpp.o\u001b[0m\n", "[ 60%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/muse-glimmer.cpp.o\u001b[0m\n", "[ 63%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/nanbeige.cpp.o\u001b[0m\n", "[ 63%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/nemotron-h-moe.cpp.o\u001b[0m\n", "[ 63%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/nemotron-h.cpp.o\u001b[0m\n", "[ 63%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/nemotron.cpp.o\u001b[0m\n", "[ 63%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/neo-bert.cpp.o\u001b[0m\n", "[ 63%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/nomic-bert-moe.cpp.o\u001b[0m\n", "[ 65%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/nomic-bert.cpp.o\u001b[0m\n", "[ 65%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/olmo.cpp.o\u001b[0m\n", "[ 65%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/olmo2.cpp.o\u001b[0m\n", "[ 65%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/olmoe.cpp.o\u001b[0m\n", "[ 65%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/openai-moe.cpp.o\u001b[0m\n", "[ 67%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/openelm.cpp.o\u001b[0m\n", "[ 67%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/orion.cpp.o\u001b[0m\n", "[ 67%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/paddleocr.cpp.o\u001b[0m\n", "[ 67%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/pangu-embed.cpp.o\u001b[0m\n", "[ 67%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/phi2.cpp.o\u001b[0m\n", "[ 67%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/phi3.cpp.o\u001b[0m\n", "[ 69%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/phimoe.cpp.o\u001b[0m\n", "[ 69%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/plamo.cpp.o\u001b[0m\n", "[ 69%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/plamo2.cpp.o\u001b[0m\n", "[ 69%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/plamo3.cpp.o\u001b[0m\n", "[ 69%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/plm.cpp.o\u001b[0m\n", "[ 71%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/pockettts.cpp.o\u001b[0m\n", "[ 71%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen.cpp.o\u001b[0m\n", "[ 71%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen2.cpp.o\u001b[0m\n", "[ 71%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen2moe.cpp.o\u001b[0m\n", "[ 71%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen2vl.cpp.o\u001b[0m\n", "[ 71%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen3.cpp.o\u001b[0m\n", "[ 73%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen35.cpp.o\u001b[0m\n", "[ 73%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen35moe.cpp.o\u001b[0m\n", "[ 73%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen3moe.cpp.o\u001b[0m\n", "[ 73%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen3next.cpp.o\u001b[0m\n", "[ 73%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen3tts.cpp.o\u001b[0m\n", "[ 76%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen3vl.cpp.o\u001b[0m\n", "[ 76%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen3vlmoe.cpp.o\u001b[0m\n", "[ 76%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/qwen4exp.cpp.o\u001b[0m\n", "[ 76%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/refact.cpp.o\u001b[0m\n", "[ 76%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/rnd1.cpp.o\u001b[0m\n", "[ 78%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/rwkv6-base.cpp.o\u001b[0m\n", "[ 78%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/rwkv6.cpp.o\u001b[0m\n", "[ 78%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/rwkv6qwen2.cpp.o\u001b[0m\n", "[ 78%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/rwkv7-base.cpp.o\u001b[0m\n", "[ 78%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/rwkv7.cpp.o\u001b[0m\n", "[ 78%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/seed-oss.cpp.o\u001b[0m\n", "[ 80%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/smallthinker.cpp.o\u001b[0m\n", "[ 80%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/smollm3.cpp.o\u001b[0m\n", "[ 80%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/stablelm.cpp.o\u001b[0m\n", "[ 80%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/starcoder.cpp.o\u001b[0m\n", "[ 80%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/starcoder2.cpp.o\u001b[0m\n", "[ 82%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/step35.cpp.o\u001b[0m\n", "[ 82%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/t5.cpp.o\u001b[0m\n", "[ 82%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/t5encoder.cpp.o\u001b[0m\n", "[ 82%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/talkie.cpp.o\u001b[0m\n", "[ 82%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/wavtokenizer-dec.cpp.o\u001b[0m\n", "[ 82%] \u001b[32mBuilding CXX object src/CMakeFiles/llama.dir/models/xverse.cpp.o\u001b[0m\n", "[ 84%] \u001b[32m\u001b[1mLinking CXX shared library ../bin/libllama.so\u001b[0m\n", "[ 84%] Built target llama\n", "[ 86%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/arg.cpp.o\u001b[0m\n", "[ 86%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/chat-auto-parser-generator.cpp.o\u001b[0m\n", "[ 86%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/chat-auto-parser-helpers.cpp.o\u001b[0m\n", "[ 86%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/chat-diff-analyzer.cpp.o\u001b[0m\n", "[ 86%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/chat-peg-parser.cpp.o\u001b[0m\n", "[ 86%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/chat.cpp.o\u001b[0m\n", "[ 89%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/common.cpp.o\u001b[0m\n", "[ 89%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/console.cpp.o\u001b[0m\n", "[ 89%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/debug.cpp.o\u001b[0m\n", "[ 89%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/download.cpp.o\u001b[0m\n", "[ 89%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/fit.cpp.o\u001b[0m\n", "[ 91%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/hf-cache.cpp.o\u001b[0m\n", "[ 91%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/imatrix-loader.cpp.o\u001b[0m\n", "[ 91%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/json-schema-to-grammar.cpp.o\u001b[0m\n", "[ 91%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/json.cpp.o\u001b[0m\n", "[ 91%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/llguidance.cpp.o\u001b[0m\n", "[ 91%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/log.cpp.o\u001b[0m\n", "[ 93%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/ngram-cache.cpp.o\u001b[0m\n", "[ 93%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/ngram-map.cpp.o\u001b[0m\n", "[ 93%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/ngram-mod.cpp.o\u001b[0m\n", "[ 93%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/peg-parser.cpp.o\u001b[0m\n", "[ 93%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/preset.cpp.o\u001b[0m\n", "[ 95%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/reasoning-budget.cpp.o\u001b[0m\n", "[ 95%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/sampling.cpp.o\u001b[0m\n", "[ 95%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/speculative.cpp.o\u001b[0m\n", "[ 95%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/subproc.cpp.o\u001b[0m\n", "[ 95%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/trie.cpp.o\u001b[0m\n", "[ 95%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/unicode.cpp.o\u001b[0m\n", "[ 97%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/jinja/lexer.cpp.o\u001b[0m\n", "[ 97%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/jinja/parser.cpp.o\u001b[0m\n", "[ 97%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/jinja/runtime.cpp.o\u001b[0m\n", "[ 97%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/jinja/value.cpp.o\u001b[0m\n", "[ 97%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/jinja/string.cpp.o\u001b[0m\n", "[100%] \u001b[32mBuilding CXX object common/CMakeFiles/llama-common.dir/jinja/caps.cpp.o\u001b[0m\n", "[100%] \u001b[32m\u001b[1mLinking CXX shared library ../bin/libllama-common.so\u001b[0m\n", "[100%] Built target llama-common\n", "[100%] \u001b[32mBuilding CXX object tools/quantize/CMakeFiles/llama-quantize-impl.dir/quantize.cpp.o\u001b[0m\n", "[100%] \u001b[32m\u001b[1mLinking CXX shared library ../../bin/libllama-quantize-impl.so\u001b[0m\n", "[100%] Built target llama-quantize-impl\n", "[100%] \u001b[32mBuilding CXX object tools/quantize/CMakeFiles/llama-quantize.dir/main.cpp.o\u001b[0m\n", "[100%] \u001b[32m\u001b[1mLinking CXX executable ../../bin/llama-quantize\u001b[0m\n", "[100%] Built target llama-quantize\n", "version: 0.3.0-dev (build 10760, commit 0f3a71be1)\n", "built with GNU 11.4.0 for Linux x86_64\n", "llama_quantize: quantizing 'agrivani_gemma_2b.gguf' to 'agrivani_gemma_2b_q4.gguf' as Q4_K_M\n", "gguf_init_from_file: failed to open GGUF file 'agrivani_gemma_2b.gguf' (No such file or directory)\n", "llama_model_quantize: failed to quantize: llama_model_loader: failed to load model from agrivani_gemma_2b.gguf\n", "llama_quantize: failed to quantize model from 'agrivani_gemma_2b.gguf'\n" ] } ], "source": [ "!git clone https://github.com/ggerganov/llama.cpp\n", "!pip install -q -r llama.cpp/requirements.txt\n", "!python llama.cpp/convert_hf_to_gguf.py agrivani_gemma_2b_merged --outfile agrivani_gemma_2b.gguf --outtype f16\n", "!cd llama.cpp && cmake -B build && cmake --build build --config Release -j 4 --target llama-quantize\n", "!./llama.cpp/build/bin/llama-quantize agrivani_gemma_2b.gguf agrivani_gemma_2b_q4.gguf Q4_K_M" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T11:44:07.651756Z", "iopub.status.busy": "2026-09-02T11:44:07.651156Z", "iopub.status.idle": "2026-09-02T11:44:08.295220Z", "shell.execute_reply": "2026-09-02T11:44:08.294098Z", "shell.execute_reply.started": "2026-09-02T11:44:07.651719Z" }, "trusted": true }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4de04024f57e43b3b330640951da6b53", "version_major": 2, "version_minor": 0 }, "text/plain": [ "tokenizer.model: 0%| | 0.00/4.24M [00:00 F16, shape = {2048, 256000}\n", "INFO:hf-to-gguf:blk.0.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.0.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.0.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.0.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.0.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.0.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.0.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.0.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.0.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.1.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.1.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.1.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.1.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.1.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.1.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.1.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.1.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.1.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.10.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.10.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.10.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.10.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.10.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.10.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.10.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.10.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.10.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.11.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.11.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.11.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.11.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.11.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.11.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.11.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.11.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.11.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.12.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.12.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.12.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.12.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.12.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.12.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.12.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.12.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.12.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.13.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.13.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.13.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.13.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.13.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.13.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.13.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.13.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.13.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.14.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.14.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.14.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.14.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.14.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.14.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.14.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.14.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.14.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.15.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.15.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.15.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.15.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.15.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.15.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.15.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.15.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.15.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.16.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.16.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.16.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.16.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.16.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.16.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.16.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.16.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.16.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.17.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.17.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.17.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.17.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.17.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.17.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.17.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.17.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.17.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.2.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.2.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.2.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.2.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.2.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.2.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.2.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.2.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.2.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.3.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.3.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.3.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.3.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.3.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.3.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.3.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.3.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.3.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.4.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.4.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.4.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.4.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.4.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.4.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.4.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.4.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.4.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.5.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.5.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.5.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.5.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.5.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.5.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.5.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.5.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.5.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.6.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.6.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.6.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.6.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.6.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.6.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.6.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.6.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.6.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.7.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.7.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.7.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.7.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.7.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.7.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.7.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.7.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.7.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.8.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.8.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.8.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.8.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.8.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.8.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.8.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.8.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.8.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.9.attn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.9.ffn_down.weight, torch.float16 --> F16, shape = {16384, 2048}\n", "INFO:hf-to-gguf:blk.9.ffn_gate.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.9.ffn_up.weight, torch.float16 --> F16, shape = {2048, 16384}\n", "INFO:hf-to-gguf:blk.9.ffn_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:blk.9.attn_k.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:blk.9.attn_output.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.9.attn_q.weight, torch.float16 --> F16, shape = {2048, 2048}\n", "INFO:hf-to-gguf:blk.9.attn_v.weight, torch.float16 --> F16, shape = {2048, 256}\n", "INFO:hf-to-gguf:output_norm.weight, torch.float16 --> F32, shape = {2048}\n", "INFO:hf-to-gguf:Set meta model\n", "INFO:hf-to-gguf:Set model parameters\n", "INFO:hf-to-gguf:Set model quantization version\n", "INFO:hf-to-gguf:Set model tokenizer\n", "WARNING:gguf.vocab:Unknown separator token '' in TemplateProcessing\n", "INFO:gguf.vocab:Setting special token type bos to 2\n", "INFO:gguf.vocab:Setting special token type eos to 1\n", "INFO:gguf.vocab:Setting special token type unk to 3\n", "INFO:gguf.vocab:Setting special token type pad to 1\n", "INFO:gguf.vocab:Setting special token type mask to 4\n", "INFO:gguf.vocab:Setting add_bos_token to True\n", "INFO:gguf.vocab:Setting add_sep_token to False\n", "INFO:gguf.vocab:Setting chat_template to {{ bos_token }}{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '' + role + '\n", "' + message['content'] | trim + '\n", "' }}{% endfor %}{% if add_generation_prompt %}{{'model\n", "'}}{% endif %}\n", "WARNING:gguf.vocab:Unknown separator token '' in TemplateProcessing\n", "WARNING:gguf.vocab:No handler for special token type prefix with id 67 - skipping\n", "WARNING:gguf.vocab:No handler for special token type suffix with id 69 - skipping\n", "WARNING:gguf.vocab:No handler for special token type middle with id 68 - skipping\n", "WARNING:gguf.vocab:No handler for special token type fsep with id 70 - skipping\n", "INFO:gguf.vocab:Setting special token type eot to 107\n", "INFO:gguf.vocab:Setting add_bos_token to True\n", "WARNING:gguf.gguf_writer:Duplicated key name 'tokenizer.ggml.add_bos_token', overwriting it with new value True of type BOOL\n", "INFO:gguf.vocab:Setting add_sep_token to False\n", "WARNING:gguf.gguf_writer:Duplicated key name 'tokenizer.ggml.add_sep_token', overwriting it with new value False of type BOOL\n", "INFO:gguf.gguf_writer:Writing the following files:\n", "INFO:gguf.gguf_writer:agrivani_gemma_2b.gguf: n_tensors = 164, total_size = 5.0G\n", "Writing: 100%|███████████████████████████| 5.01G/5.01G [00:14<00:00, 354Mbyte/s]\n", "INFO:hf-to-gguf:Model successfully exported to agrivani_gemma_2b.gguf\n", "version: 0.3.0-dev (build 10760, commit 0f3a71be1)\n", "built with GNU 11.4.0 for Linux x86_64\n", "llama_quantize: quantizing 'agrivani_gemma_2b.gguf' to 'agrivani_gemma_2b_q4.gguf' as Q4_K_M\n", "llama_model_loader: loaded meta data with 30 key-value pairs and 164 tensors from agrivani_gemma_2b.gguf (version GGUF V3 (latest))\n", "llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.\n", "llama_model_loader: - kv 0: general.architecture str = gemma\n", "llama_model_loader: - kv 1: general.type str = model\n", "llama_model_loader: - kv 2: general.name str = Agrivani_Gemma_2B_Merged\n", "llama_model_loader: - kv 3: general.size_label str = 2.5B\n", "llama_model_loader: - kv 4: gemma.context_length u32 = 8192\n", "llama_model_loader: - kv 5: gemma.embedding_length u32 = 2048\n", "llama_model_loader: - kv 6: gemma.block_count u32 = 18\n", "llama_model_loader: - kv 7: gemma.feed_forward_length u32 = 16384\n", "llama_model_loader: - kv 8: gemma.attention.head_count u32 = 8\n", "llama_model_loader: - kv 9: gemma.attention.head_count_kv u32 = 1\n", "llama_model_loader: - kv 10: gemma.attention.layer_norm_rms_epsilon f32 = 0.000001\n", "llama_model_loader: - kv 11: gemma.attention.key_length u32 = 256\n", "llama_model_loader: - kv 12: gemma.attention.value_length u32 = 256\n", "llama_model_loader: - kv 13: general.file_type u32 = 1\n", "llama_model_loader: - kv 14: general.quantization_version u32 = 2\n", "llama_model_loader: - kv 15: tokenizer.ggml.model str = llama\n", "llama_model_loader: - kv 16: tokenizer.ggml.pre str = default\n", "llama_model_loader: - kv 17: tokenizer.ggml.tokens arr[str,256000] = [\"\", \"\", \"\", \"\", ...\n", "llama_model_loader: - kv 18: tokenizer.ggml.scores arr[f32,256000] = [0.000000, 0.000000, 0.000000, 0.0000...\n", "llama_model_loader: - kv 19: tokenizer.ggml.token_type arr[i32,256000] = [3, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, ...\n", "llama_model_loader: - kv 20: tokenizer.ggml.bos_token_id u32 = 2\n", "llama_model_loader: - kv 21: tokenizer.ggml.eos_token_id u32 = 1\n", "llama_model_loader: - kv 22: tokenizer.ggml.unknown_token_id u32 = 3\n", "llama_model_loader: - kv 23: tokenizer.ggml.padding_token_id u32 = 1\n", "llama_model_loader: - kv 24: tokenizer.ggml.mask_token_id u32 = 4\n", "llama_model_loader: - kv 25: tokenizer.ggml.add_bos_token bool = true\n", "llama_model_loader: - kv 26: tokenizer.ggml.add_sep_token bool = false\n", "llama_model_loader: - kv 27: tokenizer.chat_template str = {{ bos_token }}{% if messages[0]['rol...\n", "llama_model_loader: - kv 28: tokenizer.ggml.eot_token_id u32 = 107\n", "llama_model_loader: - kv 29: tokenizer.ggml.add_space_prefix bool = false\n", "llama_model_loader: - type f32: 37 tensors\n", "llama_model_loader: - type f16: 127 tensors\n", "[ 1/ 164] output_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 2/ 164] token_embd.weight - [ 2048, 256000, 1, 1], type = f16, converting to q6_K .. size = 1000.00 MiB -> 410.16 MiB\n", "[ 3/ 164] blk.0.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 4/ 164] blk.0.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 5/ 164] blk.0.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 6/ 164] blk.0.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 7/ 164] blk.0.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q6_K .. size = 1.00 MiB -> 0.41 MiB\n", "[ 8/ 164] blk.0.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q6_K .. size = 64.00 MiB -> 26.25 MiB\n", "[ 9/ 164] blk.0.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 10/ 164] blk.0.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 11/ 164] blk.0.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 12/ 164] blk.1.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 13/ 164] blk.1.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 14/ 164] blk.1.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 15/ 164] blk.1.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 16/ 164] blk.1.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q6_K .. size = 1.00 MiB -> 0.41 MiB\n", "[ 17/ 164] blk.1.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q6_K .. size = 64.00 MiB -> 26.25 MiB\n", "[ 18/ 164] blk.1.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 19/ 164] blk.1.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 20/ 164] blk.1.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 21/ 164] blk.2.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 22/ 164] blk.2.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 23/ 164] blk.2.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 24/ 164] blk.2.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 25/ 164] blk.2.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 26/ 164] blk.2.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 27/ 164] blk.2.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 28/ 164] blk.2.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 29/ 164] blk.2.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 30/ 164] blk.3.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 31/ 164] blk.3.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 32/ 164] blk.3.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 33/ 164] blk.3.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 34/ 164] blk.3.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 35/ 164] blk.3.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 36/ 164] blk.3.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 37/ 164] blk.3.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 38/ 164] blk.3.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 39/ 164] blk.4.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 40/ 164] blk.4.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 41/ 164] blk.4.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 42/ 164] blk.4.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 43/ 164] blk.4.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q6_K .. size = 1.00 MiB -> 0.41 MiB\n", "[ 44/ 164] blk.4.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q6_K .. size = 64.00 MiB -> 26.25 MiB\n", "[ 45/ 164] blk.4.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 46/ 164] blk.4.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 47/ 164] blk.4.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 48/ 164] blk.5.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 49/ 164] blk.5.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 50/ 164] blk.5.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 51/ 164] blk.5.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 52/ 164] blk.5.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 53/ 164] blk.5.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 54/ 164] blk.5.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 55/ 164] blk.5.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 56/ 164] blk.5.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 57/ 164] blk.6.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 58/ 164] blk.6.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 59/ 164] blk.6.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 60/ 164] blk.6.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 61/ 164] blk.6.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 62/ 164] blk.6.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 63/ 164] blk.6.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 64/ 164] blk.6.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 65/ 164] blk.6.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 66/ 164] blk.7.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 67/ 164] blk.7.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 68/ 164] blk.7.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 69/ 164] blk.7.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 70/ 164] blk.7.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q6_K .. size = 1.00 MiB -> 0.41 MiB\n", "[ 71/ 164] blk.7.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q6_K .. size = 64.00 MiB -> 26.25 MiB\n", "[ 72/ 164] blk.7.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 73/ 164] blk.7.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 74/ 164] blk.7.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 75/ 164] blk.8.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 76/ 164] blk.8.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 77/ 164] blk.8.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 78/ 164] blk.8.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 79/ 164] blk.8.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 80/ 164] blk.8.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 81/ 164] blk.8.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 82/ 164] blk.8.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 83/ 164] blk.8.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 84/ 164] blk.9.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 85/ 164] blk.9.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 86/ 164] blk.9.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 87/ 164] blk.9.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 88/ 164] blk.9.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 89/ 164] blk.9.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 90/ 164] blk.9.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 91/ 164] blk.9.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 92/ 164] blk.9.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 93/ 164] blk.10.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 94/ 164] blk.10.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 95/ 164] blk.10.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 96/ 164] blk.10.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 97/ 164] blk.10.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q6_K .. size = 1.00 MiB -> 0.41 MiB\n", "[ 98/ 164] blk.10.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q6_K .. size = 64.00 MiB -> 26.25 MiB\n", "[ 99/ 164] blk.10.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 100/ 164] blk.10.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 101/ 164] blk.10.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 102/ 164] blk.11.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 103/ 164] blk.11.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 104/ 164] blk.11.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 105/ 164] blk.11.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 106/ 164] blk.11.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 107/ 164] blk.11.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 108/ 164] blk.11.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 109/ 164] blk.11.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 110/ 164] blk.11.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 111/ 164] blk.12.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 112/ 164] blk.12.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 113/ 164] blk.12.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 114/ 164] blk.12.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 115/ 164] blk.12.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 116/ 164] blk.12.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 117/ 164] blk.12.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 118/ 164] blk.12.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 119/ 164] blk.12.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 120/ 164] blk.13.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 121/ 164] blk.13.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 122/ 164] blk.13.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 123/ 164] blk.13.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 124/ 164] blk.13.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q6_K .. size = 1.00 MiB -> 0.41 MiB\n", "[ 125/ 164] blk.13.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q6_K .. size = 64.00 MiB -> 26.25 MiB\n", "[ 126/ 164] blk.13.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 127/ 164] blk.13.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 128/ 164] blk.13.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 129/ 164] blk.14.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 130/ 164] blk.14.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 131/ 164] blk.14.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 132/ 164] blk.14.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 133/ 164] blk.14.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 134/ 164] blk.14.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 135/ 164] blk.14.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 136/ 164] blk.14.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 137/ 164] blk.14.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 138/ 164] blk.15.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 139/ 164] blk.15.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 140/ 164] blk.15.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 141/ 164] blk.15.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 142/ 164] blk.15.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q6_K .. size = 1.00 MiB -> 0.41 MiB\n", "[ 143/ 164] blk.15.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q6_K .. size = 64.00 MiB -> 26.25 MiB\n", "[ 144/ 164] blk.15.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 145/ 164] blk.15.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 146/ 164] blk.15.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 147/ 164] blk.16.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 148/ 164] blk.16.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 149/ 164] blk.16.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 150/ 164] blk.16.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 151/ 164] blk.16.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q6_K .. size = 1.00 MiB -> 0.41 MiB\n", "[ 152/ 164] blk.16.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q6_K .. size = 64.00 MiB -> 26.25 MiB\n", "[ 153/ 164] blk.16.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 154/ 164] blk.16.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 155/ 164] blk.16.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 156/ 164] blk.17.attn_k.weight - [ 2048, 256, 1, 1], type = f16, converting to q4_K .. size = 1.00 MiB -> 0.28 MiB\n", "[ 157/ 164] blk.17.attn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 158/ 164] blk.17.attn_output.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 159/ 164] blk.17.attn_q.weight - [ 2048, 2048, 1, 1], type = f16, converting to q4_K .. size = 8.00 MiB -> 2.25 MiB\n", "[ 160/ 164] blk.17.attn_v.weight - [ 2048, 256, 1, 1], type = f16, converting to q6_K .. size = 1.00 MiB -> 0.41 MiB\n", "[ 161/ 164] blk.17.ffn_down.weight - [ 16384, 2048, 1, 1], type = f16, converting to q6_K .. size = 64.00 MiB -> 26.25 MiB\n", "[ 162/ 164] blk.17.ffn_gate.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "[ 163/ 164] blk.17.ffn_norm.weight - [ 2048, 1, 1, 1], type = f32, size = 0.008 MiB\n", "[ 164/ 164] blk.17.ffn_up.weight - [ 2048, 16384, 1, 1], type = f16, converting to q4_K .. size = 64.00 MiB -> 18.00 MiB\n", "llama_model_quantize_impl: model size = 4780.29 MiB (16.00 BPW)\n", "llama_model_quantize_impl: quant size = 1548.98 MiB (5.18 BPW)\n", "\n", "llama_quantize: quantize time = 129046.89 ms\n", "llama_quantize: total time = 129046.89 ms\n" ] } ], "source": [ "# Convert the fixed folder to GGUF format\n", "!python llama.cpp/convert_hf_to_gguf.py agrivani_gemma_2b_merged --outfile agrivani_gemma_2b.gguf --outtype f16\n", "\n", "# Compress the model down to 4-bit for the mobile application\n", "!./llama.cpp/build/bin/llama-quantize agrivani_gemma_2b.gguf agrivani_gemma_2b_q4.gguf Q4_K_M" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T11:56:06.851319Z", "iopub.status.busy": "2026-09-02T11:56:06.850399Z", "iopub.status.idle": "2026-09-02T12:06:27.211704Z", "shell.execute_reply": "2026-09-02T12:06:27.211027Z", "shell.execute_reply.started": "2026-09-02T11:56:06.851277Z" }, "trusted": true }, "outputs": [ { "data": { "text/html": [ "agrivani_gemma_2b_merged.zip
" ], "text/plain": [ "/kaggle/working/agrivani_gemma_2b_merged.zip" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import shutil\n", "from IPython.display import FileLink\n", "\n", "# Compress the folder into a zip file\n", "shutil.make_archive(\"agrivani_gemma_2b_merged\", 'zip', \"agrivani_gemma_2b_merged\")\n", "\n", "# Generate a direct download link\n", "display(FileLink(\"agrivani_gemma_2b_merged.zip\"))" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "execution": { "iopub.execute_input": "2026-09-02T12:10:57.371448Z", "iopub.status.busy": "2026-09-02T12:10:57.370880Z", "iopub.status.idle": "2026-09-02T12:11:42.087764Z", "shell.execute_reply": "2026-09-02T12:11:42.086923Z", "shell.execute_reply.started": "2026-09-02T12:10:57.371419Z" }, "trusted": true }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6b581ec7a9cd46c182b44d7af07bc911", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Loading weights: 0%| | 0/164 [00:00