Skip to content

Commit

Permalink
Skip lines with invalid UTF-8 encoding in boot output
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Jul 27, 2024
1 parent 60f7a69 commit 372020f
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/data/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,21 @@ impl Assistant {
)
};

while let Some(log) = lines.next().await.transpose()? {
if log.contains("HTTP server listening") {
sender
.finish(Assistant {
file,
_server: Arc::new(server),
})
.await;
while let Some(line) = lines.next().await {
if let Ok(log) = line {
if log.contains("HTTP server listening") {
sender
.finish(Assistant {
file,
_server: Arc::new(server),
})
.await;

return Ok(());
}

return Ok(());
sender.log(log).await;
}

sender.log(log).await;
}

Err(Error::ExecutorFailed("llama-server exited unexpectedly"))
Expand Down

0 comments on commit 372020f

Please sign in to comment.