Update app.py
Browse files
app.py
CHANGED
|
@@ -66,7 +66,7 @@ if submitted and location and roof_size > 0 and electricity_bill >= 0:
|
|
| 66 |
|
| 67 |
if state_data is not None:
|
| 68 |
ghi = state_data['Avg_GHI (kWh/m²/day)']
|
| 69 |
-
solar_cost_per_kw = state_data['
|
| 70 |
|
| 71 |
prompt_text = build_prompt(location, roof_size, electricity_bill, ghi, solar_cost_per_kw)
|
| 72 |
|
|
@@ -85,10 +85,10 @@ if submitted and location and roof_size > 0 and electricity_bill >= 0:
|
|
| 85 |
if ":" in point: # Only process lines with a colon
|
| 86 |
try:
|
| 87 |
# Extract the value after the colon
|
| 88 |
-
key, value = point.split(":")
|
| 89 |
st.write(f"{key.strip()}: {value.strip()}")
|
| 90 |
-
except
|
| 91 |
-
# Handle cases where the
|
| 92 |
st.warning("There was an issue processing the response.")
|
| 93 |
else:
|
| 94 |
st.error("Sorry, the location entered does not match any available data.")
|
|
|
|
| 66 |
|
| 67 |
if state_data is not None:
|
| 68 |
ghi = state_data['Avg_GHI (kWh/m²/day)']
|
| 69 |
+
solar_cost_per_kw = state_data['Solar_Cost_per_KW (₹)']
|
| 70 |
|
| 71 |
prompt_text = build_prompt(location, roof_size, electricity_bill, ghi, solar_cost_per_kw)
|
| 72 |
|
|
|
|
| 85 |
if ":" in point: # Only process lines with a colon
|
| 86 |
try:
|
| 87 |
# Extract the value after the colon
|
| 88 |
+
key, value = point.split(":", 1) # Split into two parts only
|
| 89 |
st.write(f"{key.strip()}: {value.strip()}")
|
| 90 |
+
except ValueError:
|
| 91 |
+
# Handle cases where the line doesn't split into two parts
|
| 92 |
st.warning("There was an issue processing the response.")
|
| 93 |
else:
|
| 94 |
st.error("Sorry, the location entered does not match any available data.")
|