nsarrazin HF staff commited on
Commit
6b19d45
1 Parent(s): b1cfe2a

Abort generation if an error is displayed on the front-end. (#855)

Browse files
src/routes/conversation/[id]/+page.svelte CHANGED
@@ -233,7 +233,7 @@
233
  // we read the stream until we get the final answer
234
  while (finalAnswer === "") {
235
  // check for abort
236
- if ($isAborted) {
237
  reader?.cancel();
238
  break;
239
  }
 
233
  // we read the stream until we get the final answer
234
  while (finalAnswer === "") {
235
  // check for abort
236
+ if ($isAborted || $error) {
237
  reader?.cancel();
238
  break;
239
  }