Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -50,9 +50,12 @@ if uploaded_file:
|
|
50 |
chunks.append(sentence)
|
51 |
return chunks
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
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)")
|