|
--- |
|
license: mit |
|
language: |
|
- en |
|
- multilingual |
|
widget: |
|
- text: 'Q: How can I increase the yield of my potato crop?' |
|
example_title: example 1 |
|
- text: 'Q: how do i check for corn maturity?' |
|
example_title: example 2 |
|
tags: |
|
- agriculture |
|
- agriculture llm |
|
- agriculture qa |
|
datasets: |
|
- KisanVaani/agriculture-qa-english-only |
|
--- |
|
|
|
## Note |
|
Introducing AgriQBot πΎπ€: Embarking on the journey to cultivate knowledge in agriculture! ππ± Currently in its early testing phase, AgriQBot is a multilingual small language model dedicated to agriculture. ππΎ As we harvest insights, the data generation phase is underway, and continuous improvement is the key. ππ‘ The vision? Crafting a compact yet powerful model fueled by a high-quality dataset, with plans to fine-tune it for direct tasks in the future. |
|
|
|
### Usage |
|
|
|
```python |
|
# Use a pipeline as a high-level helper |
|
from transformers import pipeline |
|
pipe = pipeline("text2text-generation", model="mrSoul7766/AgriQBot") |
|
# Example user query |
|
user_query = "How can I increase the yield of my potato crop?" |
|
# Generate response |
|
answer = pipe(f"Q: {user_query}", max_length=512) |
|
# Print the generated answer |
|
print(answer[0]['generated_text']) |
|
``` |
|
### or |
|
```python |
|
# Load model directly |
|
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM |
|
|
|
tokenizer = AutoTokenizer.from_pretrained("mrSoul7766/AgriQBot") |
|
model = AutoModelForSeq2SeqLM.from_pretrained("mrSoul7766/AgriQBot") |
|
|
|
# Set maximum generation length |
|
max_length = 512 |
|
|
|
# Generate response with question as input |
|
input_ids = tokenizer.encode("Q: How can I increase the yield of my potato crop?", return_tensors="pt") |
|
output_ids = model.generate(input_ids, max_length=max_length) |
|
|
|
# Decode response |
|
response = tokenizer.decode(output_ids[0], skip_special_tokens=True) |
|
print(response) |
|
``` |