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

Commit

Permalink
Merge pull request #438 from lucksus/main
Browse files Browse the repository at this point in the history
Fix snapshot serialization/deserialization: rename logits to last_logits
  • Loading branch information
philpax authored Nov 3, 2023
2 parents fb48749 + 58193c4 commit aeafa44
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit aeafa44

Please sign in to comment.