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.
1# Use a pipeline as a high-level helper
2from transformers import pipeline
3pipe = pipeline("text2text-generation", model="mrSoul7766/AgriQBot")
4# Example user query
5user_query = "How can I increase the yield of my potato crop?"
6# Generate response
7answer = pipe(f"Q: {user_query}", max_length=256)
8# Print the generated answer
9print(answer[0]['generated_text'])
1# Load model directly
2from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
3
4tokenizer = AutoTokenizer.from_pretrained("mrSoul7766/AgriQBot")
5model = AutoModelForSeq2SeqLM.from_pretrained("mrSoul7766/AgriQBot")
6
7# Set maximum generation length
8max_length = 256
9
10# Generate response with question as input
11input_ids = tokenizer.encode("Q: How can I increase the yield of my potato crop?", return_tensors="pt")
12output_ids = model.generate(input_ids, max_length=max_length)
13
14# Decode response
15response = tokenizer.decode(output_ids[0], skip_special_tokens=True)
16print(response)