MCPcopy Create free account
hub / github.com/ChenWu98/agent-attack / Tokenizer

Class Tokenizer

agent_attack/util/interfaces.py:16–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15# === Processor & Tokenizer Interface Definitions ===
16class Tokenizer(Protocol):
17 padding_side: str
18 pad_token_id: int
19
20 def __call__(self, text: Union[str, Sequence[str]], return_tensors: str = "pt", **kwargs) -> BatchEncoding:
21 ...
22
23 def encode(self, inputs: str, add_special_tokens: bool = False) -> List[int]:
24 ...
25
26 def decode(self, output_ids: Union[torch.Tensor, Sequence[int]], **kwargs) -> str:
27 ...
28
29 def batch_decode(self, output_ids: Union[torch.Tensor, Sequence[Sequence[int]]], **kwargs) -> List[str]:
30 ...
31
32
33class ImageProcessor(Protocol):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected