Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/llm_inference/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const modelFileName = 'gemma-2b-it-gpu-int4.bin'; /* Update the file name */
* Display newly generated partial results to the output text box.
*/
function displayPartialResults(partialResults, complete) {
output.textContent += partialResults;
output.value += partialResults;

if (complete) {
if (!output.textContent) {
output.textContent = 'Result is empty';
if (!output.value) {
output.value = 'Result is empty';
}
submit.disabled = false;
}
Expand All @@ -45,7 +45,7 @@ async function runDemo() {
let llmInference;

submit.onclick = () => {
output.textContent = '';
output.value = '';
submit.disabled = true;
llmInference.generateResponse(input.value, displayPartialResults);
};
Expand Down