Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -318,9 +318,9 @@ Answer:"""
|
|
| 318 |
return prompt
|
| 319 |
|
| 320 |
# --- Streamlit App UI ---
|
| 321 |
-
st.title("📚
|
| 322 |
|
| 323 |
-
# User input (only proceed if collection
|
| 324 |
if collection:
|
| 325 |
query = st.text_area("Enter your question:", height=100)
|
| 326 |
else:
|
|
@@ -529,17 +529,18 @@ if collection and st.button("Ask"):
|
|
| 529 |
st.info("No specific context was retrieved from the guides to answer this question.")
|
| 530 |
|
| 531 |
# Add instructions or footer
|
| 532 |
-
st.sidebar.header("
|
| 533 |
st.sidebar.info(
|
| 534 |
-
"
|
| 535 |
-
|
| 536 |
-
"
|
| 537 |
-
"3.
|
| 538 |
-
"4.
|
| 539 |
)
|
| 540 |
-
st.sidebar.header("Configuration")
|
| 541 |
-
st.sidebar.markdown(f"**Embedding:**
|
| 542 |
-
st.sidebar.markdown(f"**
|
| 543 |
-
st.sidebar.markdown(f"**
|
|
|
|
| 544 |
st.sidebar.markdown(f"**Retrieval Mode:** Vector Search Only")
|
| 545 |
st.sidebar.markdown(f"**Final Unique Chunks:** `{TOP_K}` (from initial `{INITIAL_N_RESULTS}` vector search)")
|
|
|
|
| 318 |
return prompt
|
| 319 |
|
| 320 |
# --- Streamlit App UI ---
|
| 321 |
+
st.title("📚 Experimental LibGuides RAG Demo") # Revised title
|
| 322 |
|
| 323 |
+
# User input (only proceed if collection loaded)
|
| 324 |
if collection:
|
| 325 |
query = st.text_area("Enter your question:", height=100)
|
| 326 |
else:
|
|
|
|
| 529 |
st.info("No specific context was retrieved from the guides to answer this question.")
|
| 530 |
|
| 531 |
# Add instructions or footer
|
| 532 |
+
st.sidebar.header("About This Demo")
|
| 533 |
st.sidebar.info(
|
| 534 |
+
"This is an experimental RAG demo using CUNY GC LibGuides content.\n\n"
|
| 535 |
+
"1. It loads pre-computed embeddings from a Hugging Face Dataset.\n"
|
| 536 |
+
"2. It embeds your query locally.\n"
|
| 537 |
+
"3. It uses the Hugging Face Inference API for LLM tasks (routing, generation).\n"
|
| 538 |
+
"4. Requires a `HUGGING_FACE_HUB_TOKEN` set as a Space secret (`HF_TOKEN`) or in `.env`."
|
| 539 |
)
|
| 540 |
+
st.sidebar.header("Configuration Used")
|
| 541 |
+
st.sidebar.markdown(f"**Embedding Source:** HF Dataset (`{HF_DATASET_ID}`)")
|
| 542 |
+
st.sidebar.markdown(f"**Query Embedding Model:** Local (`{LOCAL_EMBEDDING_MODEL}`)")
|
| 543 |
+
st.sidebar.markdown(f"**Generation LLM (HF API):** `{HF_GENERATION_MODEL}`")
|
| 544 |
+
st.sidebar.markdown(f"**Vector Store:** ChromaDB (In-Memory)")
|
| 545 |
st.sidebar.markdown(f"**Retrieval Mode:** Vector Search Only")
|
| 546 |
st.sidebar.markdown(f"**Final Unique Chunks:** `{TOP_K}` (from initial `{INITIAL_N_RESULTS}` vector search)")
|