chheplo commited on
Commit
5a9397d
·
1 Parent(s): 792056e

Updated Sample Questions

Browse files
Files changed (2) hide show
  1. __pycache__/logger.cpython-310.pyc +0 -0
  2. app.py +36 -29
__pycache__/logger.cpython-310.pyc ADDED
Binary file (2.6 kB). View file
 
app.py CHANGED
@@ -183,39 +183,44 @@ CSS = f"""
183
  margin: 2px 4px; /* keep your spacing */
184
  font-size: 0.8rem; /* smaller text; adjust as you like */
185
  font-weight: 400; /* 400 = “normal”; removes boldness */
 
 
 
 
 
 
186
  }}
187
  """
188
 
189
 
190
  SAMPLE_QS = [
191
- # Original four, slightly enriched
192
  "Which organic pesticide works best against aphids in cotton and how should it be applied?",
193
- "What steps can improve soil health for paddy fields in North India within one season?",
194
  "What is the ideal drip-irrigation schedule for open-field tomatoes during the Indian summer?",
195
  "Which intercropping combinations maximise maize yield while improving soil health?",
196
- "Bundelkhand, 2 ha rain-fed Vertisols, 750 mm: rank top 3 climate risks to kharif sorghum.",
197
- "Godavari delta +1.8 °C by 2040: how much should rabi-rice sowing shift?",
198
- "Coastal Odisha clay loam: AWD vs DSR—water saved (%) and yield trade-off?",
199
- "Bellary semi-arid: give a 6-step drip schedule for tomato using cumulative pan-evap.",
200
- "E-UP farmer has 5 t FYM/yr, wants 25 % urea cut in wheat: design an integrated N plan.",
201
- "Groundnut leaves pale mid-rib, dark margin, pH 8.2 sandy loam: likely deficiency and fix?",
202
- "Telangana La Niña chickpea: draft an IPM calendar using a 10-day weather forecast.",
203
- "Choose Bt vs Beauveria for diamond-back moth in crucifers at 18 °C nights—justify.",
204
- "Satara rain-shadow <600 mm: propose a 3-year crop sequence balancing income, cover, N-fixation.",
205
- "Rank pigeon-pea ICPL 87119, Maruti, Asha for short duration, Fusarium resistance, >1.2 t straw.",
206
- "NW India: CO₂-eq difference between puddled vs dry direct-seeded rice at 5 t ha⁻¹ yield.",
207
- "Uttarakhand Mollisol: 3 t ha⁻¹ rice straw annually—SOC gain over 10 years?",
208
- "Partial budget: shift 2 ha cotton to Bt + pheromone traps at ₹80 000 ha⁻¹ lint price.",
209
- "PMFBY premium 2 % for groundnut: drought-loss probability (<1 t ha⁻¹) for break-even?",
210
- "Maize NDVI drop 0.78→0.55 at tasseling: name the top 3 on-farm causes.",
211
- "Explain an algorithm that turns weekly SPAD readings into variable-rate N top-dress for wheat.",
212
- "CSA plan for tribal women millet growers in upland Jharkhand to cut drudgery and boost income.",
213
- "Critique India’s fertiliser subsidy from a CSA view and suggest one reform with GHG & equity impacts.",
214
- "List 7 KPIs to track CSA adoption in smallholder sugarcane farms in Uttar Pradesh.",
215
- "Design a split-plot trial (biochar × irrigation) on wheat in the IGP: layout & statistical test."
216
  ]
217
 
218
 
 
219
  with gr.Blocks(title="ThinkingDhenu CRSA Chat", css=CSS, theme=gr.themes.Soft()) as demo:
220
  gr.Markdown("<h2>🐮 ThinkingDhenu Chat &nbsp;<sub>Climate Resilient and Sustainable Agriculture Practices</sub></h2>")
221
 
@@ -229,13 +234,6 @@ with gr.Blocks(title="ThinkingDhenu CRSA Chat", css=CSS, theme=gr.themes.Soft())
229
  stop_btn = gr.Button("⏹ Stop", variant="stop", scale=1)
230
  clear_btn = gr.Button("🔄 Clear conversation")
231
 
232
- # Clickable sample prompts
233
- gr.Markdown("#### 💡 Sample questions")
234
- sample_btns = []
235
- with gr.Row(elem_classes=["sample-prompts"]):
236
- for q in SAMPLE_QS:
237
- sample_btns.append(gr.Button(q))
238
-
239
  # ---- Right panel ----
240
  with gr.Column(scale=1):
241
  gr.Markdown("### ⚙️ Inference Settings")
@@ -246,6 +244,15 @@ with gr.Blocks(title="ThinkingDhenu CRSA Chat", css=CSS, theme=gr.themes.Soft())
246
  rep_pen_sl = gr.Slider(1.0, 2.0, value=1.1, step=0.05, label="Repetition penalty")
247
  stream_ck = gr.Checkbox(True, label="Stream response")
248
 
 
 
 
 
 
 
 
 
 
249
  # ----- State & wiring -----
250
  state = gr.State([{"role": "system", "content": DEFAULT_SYSTEM_PROMPT}])
251
 
 
183
  margin: 2px 4px; /* keep your spacing */
184
  font-size: 0.8rem; /* smaller text; adjust as you like */
185
  font-weight: 400; /* 400 = “normal”; removes boldness */
186
+
187
+ flex: 0 0 220px; /* every button 220 px wide */
188
+
189
+ white-space: normal; /* let long text wrap inside */
190
+ text-align: center; /* centre multi-line text */
191
+ padding: 10px 12px; /* a bit more breathing room */
192
  }}
193
  """
194
 
195
 
196
  SAMPLE_QS = [
197
+ # General, High-level
198
  "Which organic pesticide works best against aphids in cotton and how should it be applied?",
199
+ "What practical steps can improve soil health for paddy fields in North India within one season?",
200
  "What is the ideal drip-irrigation schedule for open-field tomatoes during the Indian summer?",
201
  "Which intercropping combinations maximise maize yield while improving soil health?",
202
+
203
+ # Simple day-to-day queries
204
+ "Which rice variety fits flood-prone lowlands in Bihar and matures in under 140 days?",
205
+ "How can I control bacterial leaf blight in paddy using only organic inputs?",
206
+ "When should mustard be sown in Punjab to avoid frost damage and maximise yield?",
207
+ "What seed rate and row spacing should I use for hybrid maize on one acre?",
208
+
209
+ # Medium-depth, decision-making prompts
210
+ "Rank wheat varieties HD 3086, DBW 303 and PBW 826 for drought tolerance and a 5 t ha-¹ yield goal in central India.",
211
+ "For chilli in Karnataka, compare fertigation versus broadcasting urea on yield and cost–benefit.",
212
+ "Draft a three-step plan to manage fall armyworm in maize with pheromone traps and bio-pesticides.",
213
+ "Suggest two catch crops after sugarcane harvest in Uttar Pradesh that raise soil carbon and add income.",
214
+
215
+ # Deeper reasoning and CSA capability tests
216
+ "A 2 ha rain-fed Vertisol farm in Bundelkhand gets erratic 750 mm rainfall—rank the three biggest climate risks to kharif sorghum and justify the order.",
217
+ "On coastal Odisha clay loam, which saves more water—alternate wetting-and-drying or dry direct-seeded rice—and what are the expected yield trade-offs?",
218
+ "In La Niña years, chickpea in Telangana faces Helicoverpa outbreaks: build an IPM calendar using a 10-day ensemble weather forecast.",
219
+ "If 3 t ha-¹ rice straw is incorporated annually into a Mollisol in Uttarakhand, how much soil organic carbon (t C ha-¹) could accumulate over 10 years?"
 
 
220
  ]
221
 
222
 
223
+
224
  with gr.Blocks(title="ThinkingDhenu CRSA Chat", css=CSS, theme=gr.themes.Soft()) as demo:
225
  gr.Markdown("<h2>🐮 ThinkingDhenu Chat &nbsp;<sub>Climate Resilient and Sustainable Agriculture Practices</sub></h2>")
226
 
 
234
  stop_btn = gr.Button("⏹ Stop", variant="stop", scale=1)
235
  clear_btn = gr.Button("🔄 Clear conversation")
236
 
 
 
 
 
 
 
 
237
  # ---- Right panel ----
238
  with gr.Column(scale=1):
239
  gr.Markdown("### ⚙️ Inference Settings")
 
244
  rep_pen_sl = gr.Slider(1.0, 2.0, value=1.1, step=0.05, label="Repetition penalty")
245
  stream_ck = gr.Checkbox(True, label="Stream response")
246
 
247
+ with gr.Row():
248
+ with gr.Column(scale=4):
249
+ # Clickable sample prompts
250
+ gr.Markdown("#### 💡 Sample questions")
251
+ sample_btns = []
252
+ with gr.Row(elem_classes=["sample-prompts"]):
253
+ for q in SAMPLE_QS:
254
+ sample_btns.append(gr.Button(q))
255
+
256
  # ----- State & wiring -----
257
  state = gr.State([{"role": "system", "content": DEFAULT_SYSTEM_PROMPT}])
258