Instructions to use GodfreyOwino/NPK_prediction_model2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GodfreyOwino/NPK_prediction_model2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="GodfreyOwino/NPK_prediction_model2", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("GodfreyOwino/NPK_prediction_model2", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
NPK Prediction Model
This model predicts the Nitrogen, Phosphorus, and Potassium needs for crops based on various input features.
Usage
from transformers import AutoConfig, AutoModel
# Load the model
config = AutoConfig.from_pretrained("GodfreyOwino/NPK_prediction_model2", trust_remote_code=True)
model = AutoModel.from_pretrained("GodfreyOwino/NPK_prediction_model2", config=config, trust_remote_code=True)
input_data = {
'crop_name': ['maize (corn)'],
'target_yield': [150],
'field_size': [10],
'ph': [6.5],
'organic_carbon': [1.2],
'nitrogen': [0.15],
'phosphorus': [20],
'potassium': [150],
'soil_moisture': [30]
}
prediction = model(input_data)
print(prediction)
- Downloads last month
- 20