Spaces:
Sleeping
Sleeping
Update frontend.py
Browse files- frontend.py +4 -4
frontend.py
CHANGED
@@ -158,10 +158,10 @@ with tab1:
|
|
158 |
"product": data.get("product_category", "General"),
|
159 |
"churn_risk": data.get("churn_risk", "Unknown"),
|
160 |
"session_id": str(uuid.uuid4())
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
except Exception as e:
|
166 |
st.warning(f"🧪 Logging failed: {e}")
|
167 |
|
|
|
158 |
"product": data.get("product_category", "General"),
|
159 |
"churn_risk": data.get("churn_risk", "Unknown"),
|
160 |
"session_id": str(uuid.uuid4())
|
161 |
+
})
|
162 |
+
# Keep log lightweight
|
163 |
+
if len(st.session_state.churn_log) > 1000:
|
164 |
+
st.session_state.churn_log = st.session_state.churn_log[-1000:]
|
165 |
except Exception as e:
|
166 |
st.warning(f"🧪 Logging failed: {e}")
|
167 |
|