Use WebLLM tools to allow the retrieval of more contextual info.
Browse files- index.html +5 -0
index.html
CHANGED
|
@@ -211,6 +211,11 @@ If you can answer the question directly with your existing knowledge or after us
|
|
| 211 |
|
| 212 |
let currentAssistantMessageElement = null; // To update the streaming message
|
| 213 |
let embedder = null; // In-browser embedding model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
let miniTableIndexEmbeddings = []; // Stores { tableId: "users", text: "...", embedding: [...] }
|
| 215 |
let detailedSchemaEmbeddings = []; // Stores { tableId: "users", chunkId: "col_details", text: "...", embedding: [...] }
|
| 216 |
|
|
|
|
| 211 |
|
| 212 |
let currentAssistantMessageElement = null; // To update the streaming message
|
| 213 |
let embedder = null; // In-browser embedding model
|
| 214 |
+
|
| 215 |
+
// Fix: Declare engine here so it's defined when initializeModels is called
|
| 216 |
+
const engine = new webllm.MLCEngine();
|
| 217 |
+
engine.setInitProgressCallback(updateEngineInitProgressCallback);
|
| 218 |
+
|
| 219 |
let miniTableIndexEmbeddings = []; // Stores { tableId: "users", text: "...", embedding: [...] }
|
| 220 |
let detailedSchemaEmbeddings = []; // Stores { tableId: "users", chunkId: "col_details", text: "...", embedding: [...] }
|
| 221 |
|