Spaces:
Sleeping
Sleeping
Upload README.md
Browse files
README.md
CHANGED
@@ -103,18 +103,18 @@ This Space demonstrates a Retrieval-Augmented Generation (RAG) application built
|
|
103 |
|
104 |
**How it works:**
|
105 |
|
106 |
-
1. **Data Source:**
|
107 |
-
2. **
|
108 |
3. **Query Processing:**
|
109 |
-
* User queries are optionally expanded using the generation model.
|
110 |
-
* Queries are embedded using the
|
111 |
-
* ChromaDB performs a similarity search
|
112 |
4. **Generation:** The relevant chunks and the original query are passed to the `google/gemma-3-27b-it` model via the Hugging Face Inference API to generate a final answer.
|
113 |
|
114 |
**Configuration:**
|
115 |
|
116 |
-
* **Embedding
|
117 |
-
* **Generation Model:** `google/gemma-3-27b-it` (via HF Inference API)
|
118 |
* **Requires Secret:** A Hugging Face User Access Token must be added as a Space Secret named `HF_TOKEN`.
|
119 |
|
120 |
-
**Note:**
|
|
|
103 |
|
104 |
**How it works:**
|
105 |
|
106 |
+
1. **Data Source:** Pre-computed embeddings (`BAAI/bge-m3`), documents, and metadata loaded from the Hugging Face Dataset `Zwounds/Libguides_Embeddings` (originally sourced from `extracted_content.jsonl`).
|
107 |
+
2. **Database Initialization:** On startup, the application downloads the dataset and loads the data into an in-memory ChromaDB collection stored in a temporary directory. This avoids slow re-embedding on every startup.
|
108 |
3. **Query Processing:**
|
109 |
+
* User queries are optionally expanded using the generation model (`google/gemma-3-27b-it` via HF API).
|
110 |
+
* Queries are embedded using the local `BAAI/bge-m3` model (loaded into the Space).
|
111 |
+
* ChromaDB performs a similarity search using the query embedding against the pre-computed document embeddings.
|
112 |
4. **Generation:** The relevant chunks and the original query are passed to the `google/gemma-3-27b-it` model via the Hugging Face Inference API to generate a final answer.
|
113 |
|
114 |
**Configuration:**
|
115 |
|
116 |
+
* **Embedding:** Pre-computed `BAAI/bge-m3` embeddings loaded from HF Dataset `Zwounds/Libguides_Embeddings`. Query embedding uses local `BAAI/bge-m3`.
|
117 |
+
* **Generation Model:** `google/gemma-3-27b-it` (via HF Inference API).
|
118 |
* **Requires Secret:** A Hugging Face User Access Token must be added as a Space Secret named `HF_TOKEN`.
|
119 |
|
120 |
+
**Note:** Startup involves downloading the dataset and loading it into the ChromaDB collection, which is much faster than re-embedding all documents.
|