Views
No views yet
1from transformers import AutoConfig, AutoModel
2
3# Load the model
4config = AutoConfig.from_pretrained("GodfreyOwino/NPK_prediction_model2", trust_remote_code=True)
5model = AutoModel.from_pretrained("GodfreyOwino/NPK_prediction_model2", config=config, trust_remote_code=True)
6
7input_data = {
8 'crop_name': ['maize (corn)'],
9 'target_yield': [150],
10 'field_size': [10],
11 'ph': [6.5],
12 'organic_carbon': [1.2],
13 'nitrogen': [0.15],
14 'phosphorus': [20],
15 'potassium': [150],
16 'soil_moisture': [30]
17}
18
19prediction = model(input_data)
20print(prediction)