Skip to content

Commit 4c40c49

Browse files
committed
cleanup and remove HashMap#clone missed in #12
1 parent 7ba8ad9 commit 4c40c49

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/corebpe.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use fancy_regex::Regex;
22
use rustc_hash::FxHashMap as HashMap;
33
use rustc_hash::FxHashSet as HashSet;
4-
use std::sync::Arc;
54
use thread_local::ThreadLocal;
65

76
pub type Rank = u32;

src/encoding.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use crate::corebpe::CoreBPE;
22
use regex::Regex;
33
use rustc_hash::FxHashMap as HashMap;
44
use rustc_hash::FxHashSet as HashSet;
5-
use std::sync::Arc;
65
use thiserror::Error;
76
use odht::HashTableOwned;
87
use crate::rollhash::{roll_hash, roll_hash_slice};
@@ -27,7 +26,7 @@ pub struct Encoding {
2726
/// The maximum token value in the encoding.
2827
max_token_value: Rank,
2928
/// The core BPE logic implemented in Rust.
30-
core_bpe: Arc<CoreBPE>,
29+
core_bpe: CoreBPE,
3130
}
3231

3332
// TODO: make a non-generic encoding error here
@@ -96,7 +95,7 @@ impl Encoding {
9695
.ok_or_else(|| EncodingError::GenericEncodingError("No mergeable ranks found".to_string()))?;
9796

9897
let core_bpe = CoreBPE::new(
99-
mergeable_ranks.clone(),
98+
mergeable_ranks,
10099
special_tokens.clone(),
101100
pat_str,
102101
)
@@ -122,7 +121,7 @@ impl Encoding {
122121
prefixes_of_mergeable_ranks,
123122
special_tokens,
124123
max_token_value,
125-
core_bpe: Arc::new(core_bpe),
124+
core_bpe: core_bpe,
126125
})
127126
}
128127

0 commit comments

Comments
 (0)