bhagwandas commited on
Commit
b365915
·
verified ·
1 Parent(s): c2295d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -50,9 +50,12 @@ if uploaded_file:
50
  chunks.append(sentence)
51
  return chunks
52
 
53
- if 'chunks' not in st.session_state:
54
- st.session_state.chunks = convert_to_chunks(df)
55
- st.session_state.embeddings = EMBED_MODEL.encode(st.session_state.chunks)
 
 
 
56
 
57
  # --- Anomaly Detection ---
58
  st.subheader("🚨 Anomaly Detection (Isolation Forest)")
 
50
  chunks.append(sentence)
51
  return chunks
52
 
53
+ # Ensure initialization
54
+ if 'chunks' not in st.session_state or 'embeddings' not in st.session_state:
55
+ chunks = convert_to_chunks(df)
56
+ embeddings = EMBED_MODEL.encode(chunks)
57
+ st.session_state.chunks = chunks
58
+ st.session_state.embeddings = embeddings
59
 
60
  # --- Anomaly Detection ---
61
  st.subheader("🚨 Anomaly Detection (Isolation Forest)")