Spaces:
Sleeping
Sleeping
Update src/app.py
Browse files- src/app.py +3 -3
src/app.py
CHANGED
|
@@ -204,10 +204,10 @@ with st.sidebar:
|
|
| 204 |
# 2. SAFETY CHECK VISUAL
|
| 205 |
if selected_index:
|
| 206 |
# Get current model dimension dynamically
|
| 207 |
-
|
| 208 |
try:
|
| 209 |
-
emb_fn = rag_engine.get_embedding_func()
|
| 210 |
-
test_vec = emb_fn.embed_query("test")
|
| 211 |
active_model_dim = len(test_vec)
|
| 212 |
|
| 213 |
is_compatible = pm.check_dimension_compatibility(selected_index, active_model_dim)
|
|
|
|
| 204 |
# 2. SAFETY CHECK VISUAL
|
| 205 |
if selected_index:
|
| 206 |
# Get current model dimension dynamically
|
| 207 |
+
current_model = st.session_state.get("active_embed_model", "sentence-transformers/all-MiniLM-L6-v2")
|
| 208 |
try:
|
| 209 |
+
emb_fn = rag_engine.get_embedding_func(current_model)
|
| 210 |
+
test_vec = emb_fn.embed_query("this is a test")
|
| 211 |
active_model_dim = len(test_vec)
|
| 212 |
|
| 213 |
is_compatible = pm.check_dimension_compatibility(selected_index, active_model_dim)
|