From 80489634f990c28246575b9ad86ba061536f1bf7 Mon Sep 17 00:00:00 2001 From: Jorge Antonio Date: Fri, 3 Jan 2025 22:59:09 +0000 Subject: [PATCH] first commit --- atoma-service/src/streamer.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/atoma-service/src/streamer.rs b/atoma-service/src/streamer.rs index e9007930..c75eb6d6 100644 --- a/atoma-service/src/streamer.rs +++ b/atoma-service/src/streamer.rs @@ -41,6 +41,9 @@ const DATA_PREFIX: &str = "data: "; /// The keep-alive chunk const KEEP_ALIVE_CHUNK: &[u8] = b": keep-alive\n\n"; +/// The keep-alive-text chunk (used by mistralrs) +const KEEP_ALIVE_TEXT_CHUNK: &[u8] = b"keep-alive-text\n"; + /// The choices key const CHOICES: &str = "choices"; @@ -388,7 +391,7 @@ impl Stream for Streamer { self.status = StreamStatus::Started; } - if chunk.as_ref() == KEEP_ALIVE_CHUNK { + if chunk.as_ref() == KEEP_ALIVE_CHUNK || chunk.as_ref() == KEEP_ALIVE_TEXT_CHUNK { return Poll::Pending; }