MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / onTextGenerationChar

Function onTextGenerationChar

lstm-text-generation/ui.js:125–134  ·  view source on GitHub ↗
(char)

Source from the content-addressed store, hash-verified

123 * @param {string} char The just-generated character.
124 */
125export async function onTextGenerationChar(char) {
126 generatedTextInput.value += char;
127 generatedTextInput.scrollTop = generatedTextInput.scrollHeight;
128 const charCount = generatedTextInput.value.length;
129 const generateLength = parseInt(generateLengthInput.value);
130 const status = `Generating text: ${charCount}/${generateLength} complete...`;
131 logStatus(status);
132 textGenerationStatus.textContent = status;
133 await tf.nextFrame();
134}
135
136export function setUpUI() {
137 /**

Callers 1

generateTextFunction · 0.85

Calls 1

logStatusFunction · 0.70

Tested by

no test coverage detected