Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Fix snapshot serialization/deserialization: rename logits to last_logits #438

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/llm-base/src/inference_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -746,7 +746,7 @@ pub struct InferenceSnapshotRef<'a> {
/// All tokens generated by this inference session.
pub tokens: Vec<TokenId>,
/// The vector of logits that was produced after the last inference.
pub logits: Vec<f32>,
pub last_logits: Vec<f32>,
/// The contents of the 'key' memory tensor.
#[serde(with = "serde_bytes")]
pub memory_k: &'a [u8],
Expand All @@ -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(),
}
Expand Down
Loading