Skip to content

Commit

Permalink
throws error when draft_choices not cut enough (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangpatrick57 authored Apr 22, 2024
1 parent 37e0cc3 commit 6aed6ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DraftRetriever/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ impl Reader {

let (draft_choices, max_branch) = get_draft_choices(paths.clone());

if draft_choices.len() > choices as usize {
// It might not be cut enough because cut_to_choices() is best effort, as mentioned in the comment above
return Err(exceptions::PyValueError::new_err("draft_choices was not cut enough"));
}

let (draft_attn_mask, tree_indices, draft_position_ids, retrieve_indices) = generate_draft_buffers(draft_choices.clone(), max_branch);

let max_length = paths.iter().map(|path| path.len()).max().unwrap_or(0);
Expand Down

0 comments on commit 6aed6ad

Please sign in to comment.