Instructions to use EYEDOL/adtc-agri-sft-gemma2-2b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EYEDOL/adtc-agri-sft-gemma2-2b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EYEDOL/adtc-agri-sft-gemma2-2b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EYEDOL/adtc-agri-sft-gemma2-2b") model = AutoModelForCausalLM.from_pretrained("EYEDOL/adtc-agri-sft-gemma2-2b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - PEFT
How to use EYEDOL/adtc-agri-sft-gemma2-2b with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EYEDOL/adtc-agri-sft-gemma2-2b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EYEDOL/adtc-agri-sft-gemma2-2b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EYEDOL/adtc-agri-sft-gemma2-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EYEDOL/adtc-agri-sft-gemma2-2b
- SGLang
How to use EYEDOL/adtc-agri-sft-gemma2-2b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "EYEDOL/adtc-agri-sft-gemma2-2b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EYEDOL/adtc-agri-sft-gemma2-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "EYEDOL/adtc-agri-sft-gemma2-2b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EYEDOL/adtc-agri-sft-gemma2-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use EYEDOL/adtc-agri-sft-gemma2-2b with Docker Model Runner:
docker model run hf.co/EYEDOL/adtc-agri-sft-gemma2-2b
adtc-agri-sft-gemma2-2b
This model is a fine-tune of google/gemma-2-2b-it, adapted
via QLoRA (4-bit base + LoRA adapters, merged back into full weights) for
agricultural advisory Q&A aimed at smallholder farmers and extension officers
in Nigeria.
Part of the ADTC 2026 project. This is a baseline SFT run โ direct supervised fine-tuning with no distillation โ used to establish how much headroom a distillation stage could still add over the base model.
Model description
Base model:
google/gemma-2-2b-itFine-tuning method: QLoRA (4-bit NF4 quantized base, bf16 compute dtype, double quantization), adapters merged into the base weights for the published checkpoint
LoRA config: r=16, alpha=32, dropout=0.05, target modules: q_proj, down_proj, up_proj, gate_proj, k_proj, o_proj, v_proj
Task: single-turn instruction following โ given a farming scenario or question, produce a concise assessment, a practical recommendation, and (if relevant) a note on when to escalate to in-person expert help
System prompt used at train/inference time: Gemma-2's chat template does not support a
systemrole, so the prompt below is prepended into the first user turn rather than sent as a separate message:You are an offline agricultural advisory assistant for smallholder farmers and extension officers in Nigeria. Given the situation described, provide a clear assessment, a practical recommendation, and, where relevant, a note on when to seek in-person expert help. Be concise and avoid unnecessary hedging.
Training data
Combined and deduplicated (on normalized question text) from:
kaggle_csv: 36,489 examples
synthetic_market: 593 examples
synthetic_fertilizer: 598 examples
Total training examples: 35,796
Held-out eval examples: 1,884 (5% split)
Primary source: the Kaggle
agriculture_qa_final_cleaned.csvdataset (query/responsecolumns), supplemented with synthetically generated fertilizer-dosage and market/storage economics word problems to cover numeric-reasoning cases underrepresented in the base dataset.
Training procedure
Hyperparameters
| Hyperparameter | Value |
|---|---|
| Base model | google/gemma-2-2b-it |
| Max sequence length | 1024 |
| Batch size (per device) | 2 |
| Gradient accumulation steps | 8 |
| Effective batch size | 16 |
| Max steps | -1 |
| Learning rate | 0.0002 |
| LR scheduler | SchedulerType.COSINE |
| Precision | bf16 |
| Seed | 42 |
| LoRA r / alpha / dropout | 16 / 32 / 0.05 |
Training loss
| Step | Training Loss | Validation Loss | Learning Rate |
|---|---|---|---|
| 500 | 0.6988 | 0.6212 | 1.94e-04 |
| 1000 | 0.5976 | 0.5819 | 1.76e-04 |
| 1500 | 0.5669 | 0.5565 | 1.50e-04 |
| 2000 | 0.5401 | 0.5362 | 1.17e-04 |
| 2500 | 0.4900 | 0.5271 | 8.18e-05 |
| 3000 | 0.4463 | 0.5137 | 4.91e-05 |
| 3500 | 0.4337 | 0.5029 | 2.26e-05 |
| 4000 | 0.4283 | 0.4979 | 5.55e-06 |
| 4476 | โ | 0.4970 | โ |
Intended use & limitations
- Intended for offline agricultural advisory use cases (smallholder farmers, extension officers) in a Nigerian context; not validated for general-purpose assistant use or for regions/crops outside its training distribution.
- This is a baseline checkpoint for internal comparison against the un-tuned base model and, later, a distilled variant โ treat outputs as advisory, not authoritative agronomic or financial guidance, and always recommend in-person expert follow-up for high-stakes decisions.
- Evaluated informally via qualitative spot-checks on held-out prompts; formal accuracy benchmarking (ARC-Easy / domain-quality via the ADTC profiler) is tracked separately from this card.
How to use
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "EYEDOL/adtc-agri-sft-gemma2-2b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
# Gemma-2 has no "system" role โ fold the system prompt into the user turn
messages = [
{"role": "user", "content": "You are an offline agricultural advisory assistant for smallholder farmers and extension officers in Nigeria. Given the situation described, provide a clear assessment, a practical recommendation, and, where relevant, a note on when to seek in-person expert help. Be concise and avoid unnecessary hedging.
Your farming question here"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=200, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Card generated automatically at training time โ 2026-09-14 11:18 UTC.
- Downloads last month
- 215