Skip to content

Commit

Permalink
Fix continue.
Browse files Browse the repository at this point in the history
  • Loading branch information
cryscan committed Jun 8, 2024
1 parent 45c3488 commit 4cf05db
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions crates/ai00-core/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,18 +656,13 @@ impl Runtime {
slots[batch] = state;
Ok(SlotResult::Fault(batch))
}
// continue from an existing slot; no need backing as well
Some(SlotChoice::Continue(batch, len)) => {
// continue from an existing slot
Some(SlotChoice::Continue(batch, ..)) => {
log::info!("continue at slot {}", batch);
let checkout = self.checkout(context.request.state, &tokens, batch).await;
self.state.load(checkout.state, batch)?;

// retrieve the last output from the cache
assert!(checkout.prefix.len() <= len);
if checkout.prefix.len() < len {
self.state.load(checkout.state, batch)?;
}
let len = checkout.prefix.len();

let state = SlotState::Wait(
GenerateContext {
prefix: Tokens(tokens[..len].to_vec()),
Expand Down

0 comments on commit 4cf05db

Please sign in to comment.