AgriLlama is a fine-tuned large language model based on Llama3.2:1B, specifically designed to provide detailed, actionable information about plant diseases to Indian farmers. It offers clear, concise, and locally relevant guidance on disease identification, symptoms, causes, severity, and treatment measures across major crops such as Sugarcane, Maize, Cotton, Rice, and Wheat.
Features
Tailored Guidance: Provides comprehensive details on various plant diseases affecting Indian crops.
Practical Recommendations: Offers clear instructions on treatment and prevention, helping farmers manage crop health.
User-Friendly: Utilizes the Alpaca Instruct Format to generate responses in simple, accessible language.
Versatile Applications: Suitable for use by farmers, agronomists, and agricultural extension workers.
Model Details
Base Model: Llama3.2:1B
Fine-Tuning Dataset: Custom dataset of 200 samples focusing on plant diseases in Indian agriculture.
Intended Use: Assisting in the identification, explanation, and management of plant diseases.
Installation
To use AgriLlama, install the required libraries:
pip install transformers torch
Usage
Using Hugging Face Transformers
Here’s an example of how to use AgriLlama with the Hugging Face Transformers library:
python
1from transformers import AutoTokenizer, AutoModelForCausalLM
2# Load the tokenizer and model from the Hugging Face Hub3tokenizer = AutoTokenizer.from_pretrained("your-username/AgriLlama")4model = AutoModelForCausalLM.from_pretrained("your-username/AgriLlama")5# Define a prompt6prompt ="Explain Red Rot in sugarcane in simple terms for Indian farmers."7# Tokenize and generate a response8inputs = tokenizer(prompt, return_tensors="pt")9outputs = model.generate(**inputs, max_new_tokens=256)10# Decode and print the generated response11print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Note: Replace your-username/AgriLlama with the actual path of your repository.
Using Ollama
You can also use AgriLlama with Ollama, a simple way to run large language models locally.
ollama run AgriLlama "Explain Red Rot in sugarcane in simple terms for Indian farmers."
This will generate a response based on the model’s fine-tuned dataset.
Fine-Tuning and Training
AgriLlama was fine-tuned using a custom dataset created in the Alpaca Instruct Format. The dataset covers detailed plant disease information tailored to the Indian context and includes samples for:
Sugarcane: Bacterial Blight, Healthy, Red Rot
Maize: Blight, Common Rust, Gray Leaf Spot, Healthy
The fine-tuning dataset consists of carefully curated samples that provide comprehensive, accurate information designed to help users manage crop diseases effectively.
Contact
For questions or suggestions, please open an issue in the repository or contact the authors directly.