Agriculture Specialist GPT-2 Model

This is a fine-tuned GPT-2 model specialized in agriculture and farming knowledge. The model has been trained on a comprehensive dataset of agriculture-related Q&A pairs to provide expert-level responses to farming questions.

Model Details

Model Description

This model is a fine-tuned version of GPT-2 specifically designed for agriculture and farming applications. It has been trained on a diverse dataset of 53 JSONL files containing agriculture knowledge covering topics such as:

  • Crop management and rotation
  • Soil health and testing
  • Pest control and management
  • Irrigation methods (including drip irrigation)
  • Organic farming practices
  • Plant nutrition and fertilizers
  • Sustainable agriculture
  • Water management
  • Seed germination and planting
  • Agricultural biotechnology

Intended Uses & Limitations

Intended Uses

  • Agriculture education and training
  • Farming consultation and advice
  • Agricultural research assistance
  • Crop management guidance
  • Sustainable farming practices

Limitations

  • The model is specifically tuned for agriculture topics
  • Responses are based on the training data quality and coverage
  • May not be suitable for non-agriculture related questions
  • Should not be used as the sole source for critical farming decisions
  • Always consult with agricultural experts for important farming decisions

Training and Evaluation Data

Training Data

  • Dataset: Custom agriculture Q&A dataset
  • Format: JSONL files with instruction/input/output format
  • Size: 53 files with agriculture-specific content
  • Topics: Comprehensive coverage of farming and agriculture topics

Training Infrastructure

  • Hardware: CPU-based training (macOS with Apple Silicon)
  • Framework: Hugging Face Transformers
  • Training Method: Instruction tuning with agriculture Q&A data

Training Results

The model shows significant improvement over the base GPT-2 model in agriculture-related questions, providing more relevant and accurate responses to farming queries. The fine-tuning process focused on:

  • Better understanding of agriculture terminology
  • Improved response quality for farming questions
  • Enhanced knowledge of sustainable practices
  • More accurate technical information

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

# Load model
tokenizer = AutoTokenizer.from_pretrained("kunaliitkgp09/agriculture-specialist-gpt2")
model = AutoModelForCausalLM.from_pretrained("kunaliitkgp09/agriculture-specialist-gpt2")

# Set pad token
if tokenizer.pad_token is None:
    tokenizer.pad_token = tokenizer.eos_token

# Example usage
question = "What are the best practices for organic farming?"
prompt = f"### Instruction:
{question}

### Response:
"

inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=512)

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=200,
        temperature=0.8,
        do_sample=True,
        top_p=0.9,
        top_k=50,
        pad_token_id=tokenizer.eos_token_id,
        eos_token_id=tokenizer.eos_token_id,
        repetition_penalty=1.1,
    )

response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)

Environmental Impact

  • Hardware Type: CPU-based training (Apple Silicon M1/M2)
  • Hours used: ~2-3 hours for complete fine-tuning
  • Cloud Provider: Local training
  • Compute Region: Local development
  • Carbon Emitted: Minimal (local CPU training)

Citation

If you use this model in your research or applications, please cite:

@misc{agriculture-specialist-gpt2,
  title={Agriculture Specialist GPT-2 Model},
  author={Kunal Dhanda},
  year={2024},
  url={https://huggingface.co/kunaliitkgp09/agriculture-specialist-gpt2},
  note={Fine-tuned GPT-2 model for agriculture Q&A}
}

Acknowledgments

  • Hugging Face for the transformers library
  • OpenAI for the base GPT-2 model
  • The agriculture community for providing valuable knowledge
  • Open source contributors who made this project possible

Model Card Contact

For questions about this model, please contact:

Downloads last month
3
Safetensors
Model size
124M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Evaluation results

  • Agriculture Knowledge Accuracy on Agriculture Q&A Dataset
    self-reported
    Improved over base GPT-2