Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,6 +20,13 @@ def recommend_crop(nitrogen, phosphorus, potassium, temperature, humidity, ph, r
|
|
20 |
|
21 |
return crops_pred[0] # Return the predicted crop name
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
# Create the Gradio interface
|
24 |
interface = gr.Interface(
|
25 |
fn=recommend_crop,
|
@@ -33,6 +40,7 @@ interface = gr.Interface(
|
|
33 |
gr.Number(label="Rainfall - Rainfall in mm")
|
34 |
],
|
35 |
outputs=gr.Textbox(label="Recommended Crop"),
|
|
|
36 |
title="Acres - CR",
|
37 |
description="Acres Crop Recommendation recommends the best crop to plant based on soil and climate conditions."
|
38 |
)
|
|
|
20 |
|
21 |
return crops_pred[0] # Return the predicted crop name
|
22 |
|
23 |
+
# Example inputs for the Gradio app
|
24 |
+
examples = [
|
25 |
+
[90, 42, 43, 20, 82, 6.5, 202],
|
26 |
+
[80, 30, 40, 25, 60, 6.8, 150],
|
27 |
+
[95, 55, 50, 28, 70, 7.0, 120]
|
28 |
+
]
|
29 |
+
|
30 |
# Create the Gradio interface
|
31 |
interface = gr.Interface(
|
32 |
fn=recommend_crop,
|
|
|
40 |
gr.Number(label="Rainfall - Rainfall in mm")
|
41 |
],
|
42 |
outputs=gr.Textbox(label="Recommended Crop"),
|
43 |
+
examples=examples,
|
44 |
title="Acres - CR",
|
45 |
description="Acres Crop Recommendation recommends the best crop to plant based on soil and climate conditions."
|
46 |
)
|