from collections.abc import Sequence
from os import PathLike
from typing import Any, final
@final
class BpeEncoderBase:
def __new__(cls, /, spec: str, char_level: str, vocabs: dict[Sequence[int], int] | None, merges: Sequence[tuple[Sequence[int], Sequence[int]]] | None, vocab_filename: str | PathLike | None, merges_filename: str | PathLike | None, special_tokens: Sequence[str] | None) -> BpeEncoderBase: ...
def decode(self, /, idxs: Any) -> str: ...
def encode_file(self, /, path: str | PathLike, num_chunks: int) -> Any: ...
def encode_string(self, /, s: str) -> Any: ...
def encode_word(self, /, word: str) -> list[int]: ...
def encode_words(self, /, words: Sequence[str]) -> list[list[int]]: ...
def pre_tokenizer(self, /) -> PreTokenizer: ...
class BpeTrainerBase: ...
@final
class BpeTrainer_Character_CharIdx(BpeTrainerBase):
def __new__(cls, /, special_tokens: Sequence[str]) -> BpeTrainer_Character_CharIdx: ...
def add_words(self, /, words: Sequence[tuple[str, int]]) -> None: ...
def get_vocabs(self, /) -> Vocabs: ...
def init_training(self, /) -> None: ...
def save_merges_txt(self, /, path: str | PathLike, spec: str) -> None: ...
def save_vocab(self, /, path: str | PathLike, spec: str) -> None: ...
def step(self, /) -> int: ...
def vocab_size(self, /) -> int: ...
@final
class BpeTrainer_u8_Idx(BpeTrainerBase):
def __new__(cls, /, special_tokens: Sequence[str]) -> BpeTrainer_u8_Idx: ...
def add_words(self, /, words: Sequence[tuple[str, int]]) -> None: ...
def get_vocabs(self, /) -> Vocabs: ...
def init_training(self, /) -> None: ...
def save_merges_txt(self, /, path: str | PathLike, spec: str) -> None: ...
def save_vocab(self, /, path: str | PathLike, spec: str) -> None: ...
def step(self, /) -> int: ...
def vocab_size(self, /) -> int: ...
@final
class PreTokenizer:
def __new__(cls, /, special_tokens: Sequence[str], eot_token: str | None = None, pat: str | None = None) -> PreTokenizer: ...
def find_chunk_boundaries(self, /, path: str | PathLike, desired_num_chunks: int = 1024) -> list[tuple[int, int]]: ...
def get_words_from_file(self, /, path: str | PathLike, desired_num_chunks: int = 1024) -> dict[str, int]: ...
def get_words_from_segment(self, /, path: str | PathLike, offset: int, length: int) -> dict[str, int]: ...
@final
class Vocabs:
def get(self, /, word: str) -> int | None: ...
def items(self, /) -> list[tuple[bytes, int]]: ...
@property
def len(self, /) -> int: ...