mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-12 04:44:52 +00:00
Last reference.
This commit is contained in:
parent
b043f56ed2
commit
9e45a09a0a
@ -225,7 +225,6 @@ struct RadixAllocation {
|
|||||||
pub enum TrieError {
|
pub enum TrieError {
|
||||||
InvalidNodeId,
|
InvalidNodeId,
|
||||||
RefCountUnderflow,
|
RefCountUnderflow,
|
||||||
BlockTokenCountMismatch,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type NodeId = DefaultKey;
|
pub type NodeId = DefaultKey;
|
||||||
@ -422,11 +421,10 @@ impl RadixTrie {
|
|||||||
// the part of the prefix that is already in the trie to detect
|
// the part of the prefix that is already in the trie to detect
|
||||||
// mismatches.
|
// mismatches.
|
||||||
|
|
||||||
if tokens.len() != blocks.len() * self.block_size {
|
assert_eq!(tokens.len(), blocks.len() * self.block_size);
|
||||||
return Err(TrieError::BlockTokenCountMismatch);
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(&child_id) = self.nodes[node_id].children.get(&tokens[0]) {
|
let node_key = hash_(&tokens[..self.block_size]);
|
||||||
|
if let Some(&child_id) = self.nodes[node_id].children.get(&node_key) {
|
||||||
self.update_access_time(child_id);
|
self.update_access_time(child_id);
|
||||||
let child = self
|
let child = self
|
||||||
.nodes
|
.nodes
|
||||||
|
Loading…
Reference in New Issue
Block a user