From 58193c4da9cb57f94a8467143ed4173b762eac18 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Fri, 3 Nov 2023 01:08:59 +0100 Subject: [PATCH] Fix snapshot serde: rename logits to last_logits --- crates/llm-base/src/inference_session.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/llm-base/src/inference_session.rs b/crates/llm-base/src/inference_session.rs index 8c86b0e1..493513e6 100644 --- a/crates/llm-base/src/inference_session.rs +++ b/crates/llm-base/src/inference_session.rs @@ -608,7 +608,7 @@ impl InferenceSession { npast: self.n_past, config: self.config, tokens: self.tokens.clone(), - logits: self.last_logits.clone(), + last_logits: self.last_logits.clone(), memory_k, memory_v, } @@ -746,7 +746,7 @@ pub struct InferenceSnapshotRef<'a> { /// All tokens generated by this inference session. pub tokens: Vec, /// The vector of logits that was produced after the last inference. - pub logits: Vec, + pub last_logits: Vec, /// The contents of the 'key' memory tensor. #[serde(with = "serde_bytes")] pub memory_k: &'a [u8], @@ -763,7 +763,7 @@ impl InferenceSnapshotRef<'_> { npast: self.npast, config: self.config, tokens: self.tokens.clone(), - last_logits: self.logits.clone(), + last_logits: self.last_logits.clone(), memory_k: self.memory_k.to_vec(), memory_v: self.memory_v.to_vec(), }