llama.cpp/llama_cpp
Austin 6bfe98bd80
Integration of Jinja2 Templating (#875)
* feat: Add support for jinja templating

Signed-off-by: teleprint-me <77757836+teleprint-me@users.noreply.github.com>

* fix: Refactor chat formatter and update interface for jinja templates

- Simplify the `llama2_template` in `llama_jinja_format.py` by removing unnecessary line breaks for readability without affecting functionality.
- Update `ChatFormatterInterface` constructor to accept a more generic `Optional[object]` type for the template parameter, enhancing flexibility.
- Introduce a `template` property to `ChatFormatterInterface` for standardized access to the template string.
- Replace `MetaSingleton` metaclass with `Singleton` for the `ChatFormatterFactory` to streamline the singleton implementation.

These changes enhance code readability, maintain usability, and ensure consistency in the chat formatter's design pattern usage.

* Add outline for Jinja2 templating integration documentation

Signed-off-by: teleprint-me <77757836+teleprint-me@users.noreply.github.com>

* Add jinja2 as a dependency with version range for Hugging Face transformers compatibility

Signed-off-by: teleprint-me <77757836+teleprint-me@users.noreply.github.com>

* Update jinja2 version constraint for mkdocs-material compatibility

Signed-off-by: teleprint-me <77757836+teleprint-me@users.noreply.github.com>

* Fix attribute name in AutoChatFormatter

- Changed attribute name from `self._renderer` to `self._environment`

---------

Signed-off-by: teleprint-me <77757836+teleprint-me@users.noreply.github.com>
2024-01-17 09:47:52 -05:00
..
server fix(cli): allow passing n_ctx=0 to openAI API server args to use model n_ctx_train field per #1015 (#1093) 2024-01-16 18:54:06 -05:00
__init__.py Bump version 2024-01-15 12:54:51 -05:00
_internals.py Move helper classes to _internals submodule 2024-01-17 09:14:00 -05:00
_utils.py Avoid "LookupError: unknown encoding: ascii" when open() called in a destructor (#1012) 2024-01-15 10:52:10 -05:00
llama.py Re-order classes in llama.py 2024-01-17 09:16:13 -05:00
llama_cache.py Move cache classes to llama_cache submodule. 2024-01-17 09:09:12 -05:00
llama_chat_format.py Add Saiga chat format. (#1050) 2024-01-04 18:12:58 -05:00
llama_cpp.py Update llama.cpp 2024-01-15 10:12:10 -05:00
llama_grammar.py Fix Pydantic model parsing (#1087) 2024-01-15 10:45:57 -05:00
llama_jinja_format.py Integration of Jinja2 Templating (#875) 2024-01-17 09:47:52 -05:00
llama_types.py Add missing tool_calls finish_reason 2023-11-10 02:51:06 -05:00
llava_cpp.py Make building llava optional 2023-11-28 04:55:21 -05:00
py.typed Add py.typed 2023-08-11 09:58:48 +02:00