(cls, pretrained_model_name_or_path: str)
| 107 | |
| 108 | @classmethod |
| 109 | def from_pretrained(cls, pretrained_model_name_or_path: str) -> "LlamaHFTokenizer": |
| 110 | try: |
| 111 | from transformers import AutoTokenizer |
| 112 | except ImportError: |
| 113 | raise ImportError( |
| 114 | "The `transformers` library is required to use the `HFTokenizer`." |
| 115 | "You can install it with `pip install transformers`." |
| 116 | ) |
| 117 | hf_tokenizer = AutoTokenizer.from_pretrained( |
| 118 | pretrained_model_name_or_path=pretrained_model_name_or_path |
| 119 | ) |
| 120 | return cls(hf_tokenizer) |
nothing calls this directly
no outgoing calls
no test coverage detected