Add error handling of NAI streaming.

This commit is contained in:
Cohee
2023-08-28 00:28:11 +03:00
parent 3b4e6f0b78
commit 2199096191
2 changed files with 24 additions and 2 deletions

View File

@@ -172,6 +172,8 @@ async function generateHypeBot() {
const output = decodeTextTokens(tokenizers.GPT2, ids).replace(/<2F>/g, '').trim();
setHypeBotText(formatReply(output));
} else {
setHypeBotText('<div class="hypebot_error">Something went wrong while generating a HypeBot reply. Please try again.</div>');
}
}