Downloads · 30 days
2
5% of all-time downloads
kunaliitkgp09/agriculture-specialist-gpt2
agriculture-specialist-gpt2 is a machine learning model from kunaliitkgp09. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
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 qu…
Downloads · 30 days
2
5% of all-time downloads
All-time downloads
38
Public
Parameters
124M
498 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors498 MB · 99%
From the Hugging Face model README
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.
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:
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:
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)
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}
}
For questions about this model, please contact: