async function onTextGenerationChar(char) {
  generatedTextInput.value += char;
  generatedTextInput.scrollTop = generatedTextInput.scrollHeight;
  const charCount = generatedTextInput.value.length;
  const generateLength = parseInt(generateLengthInput.value);
  const status = `Generating text: ${charCount}/${generateLength} complete...`;
  logStatus(status);
  textGenerationStatus.textContent = status;
  await tf.nextFrame();
}
A function to call each time a character is obtained during text generation.

@param {string} char The just-generated character.