Update index.js
Browse files
index.js
CHANGED
@@ -24,6 +24,7 @@ const uploadInput = document.getElementById('upload');
|
|
24 |
let ortSessionA, ortSessionB, ortSessionC, ortSessionD, ortSessionE;
|
25 |
let config;
|
26 |
let currentImage = '';
|
|
|
27 |
|
28 |
async function initializeSessions() {
|
29 |
status.textContent = 'Loading model...';
|
@@ -383,12 +384,13 @@ uploadInput.addEventListener('change', (e) => {
|
|
383 |
});
|
384 |
|
385 |
promptInput.addEventListener('keypress', (e) => {
|
|
|
386 |
if (e.key === 'Enter') {
|
387 |
if (!currentImage) {
|
388 |
status.textContent = 'Please select an image first';
|
389 |
return;
|
390 |
}
|
391 |
-
handleQuery(currentImage,
|
392 |
}
|
393 |
});
|
394 |
|
|
|
24 |
let ortSessionA, ortSessionB, ortSessionC, ortSessionD, ortSessionE;
|
25 |
let config;
|
26 |
let currentImage = '';
|
27 |
+
let currentQuery = '';
|
28 |
|
29 |
async function initializeSessions() {
|
30 |
status.textContent = 'Loading model...';
|
|
|
384 |
});
|
385 |
|
386 |
promptInput.addEventListener('keypress', (e) => {
|
387 |
+
currentQuery = e.target.value;
|
388 |
if (e.key === 'Enter') {
|
389 |
if (!currentImage) {
|
390 |
status.textContent = 'Please select an image first';
|
391 |
return;
|
392 |
}
|
393 |
+
handleQuery(currentImage, currentQuery);
|
394 |
}
|
395 |
});
|
396 |
|