Spaces:
Running
Running
MaduRox commited on
Commit ·
d728fc9
1
Parent(s): 8ca1f22
feat: deploy Kalpana RIF O(1) Studio with Needle-in-a-Haystack benchmarks, layer architecture, and Swagger API
Browse files
app.js
CHANGED
|
@@ -15,7 +15,7 @@ let ingestedChunks = [];
|
|
| 15 |
const chatHistory = document.getElementById('chatHistory');
|
| 16 |
const chatInput = document.getElementById('chatInput');
|
| 17 |
const btnSend = document.getElementById('btnSendChat') || document.getElementById('btnSend');
|
| 18 |
-
const tabButtons = document.querySelectorAll('.nav-btn');
|
| 19 |
const tabPanes = document.querySelectorAll('.tab-pane');
|
| 20 |
|
| 21 |
const btnOpenIngestModal = document.getElementById('btnOpenIngestModal');
|
|
@@ -30,14 +30,22 @@ const btnRunH2H = document.getElementById('btnRunH2H');
|
|
| 30 |
tabButtons.forEach((btn) => {
|
| 31 |
btn.addEventListener('click', () => {
|
| 32 |
const target = btn.getAttribute('data-tab');
|
|
|
|
| 33 |
tabButtons.forEach((b) => b.classList.remove('active'));
|
| 34 |
tabPanes.forEach((p) => p.classList.remove('active'));
|
| 35 |
btn.classList.add('active');
|
| 36 |
-
|
|
|
|
| 37 |
if (pane) pane.classList.add('active');
|
| 38 |
});
|
| 39 |
});
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
// --- Semantic Feature Embedding (Word & Bigram Hashing into 384-Dim Vector) ---
|
| 42 |
function computeSemanticEmbedding(text, dim = 384) {
|
| 43 |
const vec = new Float32Array(dim);
|
|
|
|
| 15 |
const chatHistory = document.getElementById('chatHistory');
|
| 16 |
const chatInput = document.getElementById('chatInput');
|
| 17 |
const btnSend = document.getElementById('btnSendChat') || document.getElementById('btnSend');
|
| 18 |
+
const tabButtons = document.querySelectorAll('.nav-tab, .nav-btn');
|
| 19 |
const tabPanes = document.querySelectorAll('.tab-pane');
|
| 20 |
|
| 21 |
const btnOpenIngestModal = document.getElementById('btnOpenIngestModal');
|
|
|
|
| 30 |
tabButtons.forEach((btn) => {
|
| 31 |
btn.addEventListener('click', () => {
|
| 32 |
const target = btn.getAttribute('data-tab');
|
| 33 |
+
if (!target) return;
|
| 34 |
tabButtons.forEach((b) => b.classList.remove('active'));
|
| 35 |
tabPanes.forEach((p) => p.classList.remove('active'));
|
| 36 |
btn.classList.add('active');
|
| 37 |
+
let pane = document.getElementById(target);
|
| 38 |
+
if (!pane) pane = document.getElementById(`tab-${target}`);
|
| 39 |
if (pane) pane.classList.add('active');
|
| 40 |
});
|
| 41 |
});
|
| 42 |
|
| 43 |
+
// Expose swagger accordions toggle globally
|
| 44 |
+
window.toggleSwagger = function(el) {
|
| 45 |
+
const endpoint = el.closest('.swagger-endpoint');
|
| 46 |
+
if (endpoint) endpoint.classList.toggle('open');
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
// --- Semantic Feature Embedding (Word & Bigram Hashing into 384-Dim Vector) ---
|
| 50 |
function computeSemanticEmbedding(text, dim = 384) {
|
| 51 |
const vec = new Float32Array(dim);
|