Ayesha-Majeed commited on
Commit
5865aaa
·
verified ·
1 Parent(s): 0d22e08

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -42,9 +42,9 @@ def predict_linear(strain, dose, soil_n, soil_p, soil_k, ph,
42
  if any(v is None for v in required):
43
  logs.append("[DEBUG] Missing numeric inputs!")
44
  return pd.DataFrame(), "\n⚠️ Fill all required inputs", "\n".join(logs)
45
- if any(v is 0 for v in required):
46
- logs.append("[DEBUG] Missing numeric inputs!")
47
- return pd.DataFrame(), "\n⚠️ Fill all required inputs", "\n".join(logs)
48
  logs.append("[DEBUG] Inputs received.")
49
 
50
  # Prepare DataFrame for model
@@ -120,11 +120,11 @@ with gr.Blocks(
120
  # row_selector = gr.Dropdown(row_options, label="Select Row", value="None, Enter Manually")
121
 
122
  gr.Markdown("### Input Parameters")
123
- dose = gr.Number(label="Dose (g/pot)")
124
- soil_n = gr.Number(label="Soil N (ppm)")
125
- soil_p = gr.Number(label="Soil P (ppm)")
126
- soil_k = gr.Number(label="Soil K (ppm)")
127
- ph = gr.Number(label="pH")
128
 
129
  # gr.Markdown("### Autofilled Actual Metrics (from Excel)")
130
  # chlorophyll = gr.Number(label="Chlorophyll (SPAD)")
 
42
  if any(v is None for v in required):
43
  logs.append("[DEBUG] Missing numeric inputs!")
44
  return pd.DataFrame(), "\n⚠️ Fill all required inputs", "\n".join(logs)
45
+ # if any(v is 0 for v in required):
46
+ # logs.append("[DEBUG] Missing numeric inputs!")
47
+ # return pd.DataFrame(), "\n⚠️ Fill all required inputs", "\n".join(logs)
48
  logs.append("[DEBUG] Inputs received.")
49
 
50
  # Prepare DataFrame for model
 
120
  # row_selector = gr.Dropdown(row_options, label="Select Row", value="None, Enter Manually")
121
 
122
  gr.Markdown("### Input Parameters")
123
+ dose = gr.Number(label="Dose (g/pot)",value = None)
124
+ soil_n = gr.Number(label="Soil N (ppm)",value = None)
125
+ soil_p = gr.Number(label="Soil P (ppm)",value = None)
126
+ soil_k = gr.Number(label="Soil K (ppm)",value = None)
127
+ ph = gr.Number(label="pH",value = None)
128
 
129
  # gr.Markdown("### Autofilled Actual Metrics (from Excel)")
130
  # chlorophyll = gr.Number(label="Chlorophyll (SPAD)")