File size: 1,754 Bytes
92dc025
 
37062e1
 
 
 
c3b337b
37062e1
c3b337b
37062e1
 
 
 
 
92dc025
37062e1
 
2ecdd17
 
313551d
 
2ecdd17
 
 
 
 
 
 
c3b337b
2ecdd17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c3b337b
2ecdd17
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
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
---

## 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)
```