mrSoul7766
commited on
Commit
•
c3b337b
1
Parent(s):
397dcab
Update README.md
Browse files
README.md
CHANGED
@@ -4,9 +4,9 @@ language:
|
|
4 |
- en
|
5 |
- multilingual
|
6 |
widget:
|
7 |
-
- text: '
|
8 |
example_title: example 1
|
9 |
-
- text: '
|
10 |
example_title: example 2
|
11 |
tags:
|
12 |
- agriculture
|
@@ -30,7 +30,7 @@ pipe = pipeline("text2text-generation", model="mrSoul7766/AgriQBot")
|
|
30 |
user_query = "How can I increase the yield of my potato crop?"
|
31 |
|
32 |
# Generate response
|
33 |
-
answer = pipe(f"
|
34 |
|
35 |
# Print the generated answer
|
36 |
print(answer[0]['generated_text'])
|
@@ -47,7 +47,7 @@ model = AutoModelForSeq2SeqLM.from_pretrained("mrSoul7766/AgriQBot")
|
|
47 |
max_length = 512
|
48 |
|
49 |
# Generate response with question as input
|
50 |
-
input_ids = tokenizer.encode("
|
51 |
output_ids = model.generate(input_ids, max_length=max_length)
|
52 |
|
53 |
# Decode response
|
|
|
4 |
- en
|
5 |
- multilingual
|
6 |
widget:
|
7 |
+
- text: 'Q: How can I increase the yield of my potato crop?'
|
8 |
example_title: example 1
|
9 |
+
- text: 'Q: how do i check for corn maturity?'
|
10 |
example_title: example 2
|
11 |
tags:
|
12 |
- agriculture
|
|
|
30 |
user_query = "How can I increase the yield of my potato crop?"
|
31 |
|
32 |
# Generate response
|
33 |
+
answer = pipe(f"Q: {user_query}", max_length=512)
|
34 |
|
35 |
# Print the generated answer
|
36 |
print(answer[0]['generated_text'])
|
|
|
47 |
max_length = 512
|
48 |
|
49 |
# Generate response with question as input
|
50 |
+
input_ids = tokenizer.encode("Q: How can I increase the yield of my potato crop?", return_tensors="pt")
|
51 |
output_ids = model.generate(input_ids, max_length=max_length)
|
52 |
|
53 |
# Decode response
|