Allow resume of truncated petals completions

This commit is contained in:
Webifi 2023-08-19 18:52:53 -05:00
parent 8ce425722b
commit 54aac40788
1 changed files with 3 additions and 0 deletions

View File

@ -156,6 +156,9 @@ export const chatRequest = async (
chatRequest.updatingMessage = '' chatRequest.updatingMessage = ''
const response = JSON.parse(event.data) const response = JSON.parse(event.data)
if (!response.ok) { if (!response.ok) {
if (response.traceback.includes('Maximum length exceeded')) {
return chatResponse.finish('length')
}
const err = new Error('Error in response: ' + response.traceback) const err = new Error('Error in response: ' + response.traceback)
console.error(err) console.error(err)
chatResponse.updateFromError(err.message) chatResponse.updateFromError(err.message)