mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-22 16:25:30 +00:00
Python - BPE construction
This commit is contained in:
@ -30,11 +30,8 @@ pub struct BPE {}
|
||||
#[pymethods]
|
||||
impl BPE {
|
||||
#[staticmethod]
|
||||
fn from_files() -> PyResult<Model> {
|
||||
match tk::models::bpe::BPE::from_files(
|
||||
"../../data/gpt2-vocab.json",
|
||||
"../../data/gpt2-merges.txt",
|
||||
) {
|
||||
fn from_files(vocab: &str, merges: &str) -> PyResult<Model> {
|
||||
match tk::models::bpe::BPE::from_files(vocab, merges) {
|
||||
Err(e) => {
|
||||
println!("Error: {:?}", e);
|
||||
Err(exceptions::Exception::py_err(
|
||||
|
Reference in New Issue
Block a user