novelai_api.BanList

class BanList[source]

Bases: object

__init__(*sequences: List[int] | str, enabled: bool = True)[source]

Create a ban list with the given elements. Elements can be string or tokenized strings Using tokenized strings is not recommended, for flexibility between tokenizers

Parameters:

enabled – Is the ban list enabled

enabled: bool
add(*sequences: Dict[str, List[List[int]]] | Dict[str, List[int]] | List[int] | str) novelai_api.BanList.BanList[source]

Add elements to the ban list. Elements can be string or tokenized strings Using tokenized strings is not recommended, for flexibility between tokenizers

get_tokenized_entries(model: novelai_api.Preset.Model) Iterable[List[int]][source]

Return the tokenized sequences for the ban list, if it is enabled

Parameters:

model – Model to use for tokenization