CoolFace
Modelpublic

skarahe26/agribot-smollm2-lora

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes15downloads
Model Card

AgriBot — Plant Disease Mini-Expert

Fine-tuned SmolLM2-1.7B on LeafNet dataset using QLoRA for plant disease identification and treatment recommendation.

Training

  • —Base model: SmolLM2-1.7B-Instruct
  • —Dataset: enalis/LeafNet (49,497 balanced examples, 89 classes)
  • —Method: QLoRA 4-bit NF4, LoRA r=16
  • —Steps: 3,075 | Final loss: 0.116
  • —Platform: Kaggle T4 (free tier)

Usage

python
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
import torch

base = AutoModelForCausalLM.from_pretrained(
    "HuggingFaceTB/SmolLM2-1.7B-Instruct",
    quantization_config=BitsAndBytesConfig(load_in_4bit=True),
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("skarahe26/agribot-smollm2-lora")
model = PeftModel.from_pretrained(base, "skarahe26/agribot-smollm2-lora")

prompt = """### Instruction:
You are AgriBot, a plant pathology expert. Identify the disease and suggest treatment.

### Input:
Leaf observation: Coffee leaf with orange powdery pustules on underside.

### Response:
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=150, temperature=0.3, do_sample=True)
print(tokenizer.decode(output[0], skip_special_tokens=True))

W&B Training Report

https://wandb.ai/surbhikarahe-davv/agribot-thesis