in aidial_adapter_openai/utils/tokenizer.py [0:0]
def __init__(self, model: str) -> None:
self.model = model
try:
self.encoding = encoding_for_model(model)
except KeyError as e:
raise InternalServerError(
f"Could not find tokenizer for the model {model!r} in tiktoken. "
"Consider mapping the model to an existing tokenizer via MODEL_ALIASES env var, "
"or declare it as a model which doesn't require tokenization through tiktoken.",
) from e