MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / __init__

Method __init__

examples/server/server.py:3484–3494  ·  view source on GitHub ↗
(self, template: str, *, bos_token: str, eos_token: str)

Source from the content-addressed store, hash-verified

3482
3483class Jinja2ChatFormatter:
3484 def __init__(self, template: str, *, bos_token: str, eos_token: str) -> None:
3485 self._eos_token = eos_token
3486 self._bos_token = bos_token
3487 self._template_text = template
3488 environment = ImmutableSandboxedEnvironment(
3489 loader=jinja2.BaseLoader(),
3490 trim_blocks=True,
3491 lstrip_blocks=True,
3492 )
3493 environment.filters["from_json"] = self._from_json
3494 self._template = environment.from_string(template)
3495
3496 @staticmethod
3497 def _from_json(value: Any) -> Any:

Callers

nothing calls this directly

Calls 1

from_stringMethod · 0.80

Tested by

no test coverage detected