|
ember.cpp 0.1.0
C++ inference engine for Llama-family and paperkiln models (CPU, CUDA, WebAssembly)
|
#include <chat_tokenizer.h>

Public Member Functions | |
| bool | is_eos (int id) const |
| bool | is_stop (int id) const |
| std::vector< int > | stop_ids () const |
| bool | v1_markers () const |
| std::string | prompt (const std::vector< std::pair< std::string, std::string > > &turns, size_t from, const std::string &user, const std::string *system=nullptr, int thinking=-1) const |
Static Public Member Functions | |
| static ChatFormat | of (const chat::Template &t, const std::vector< std::string > &tokens, std::string why) |
Public Attributes | |
| chat::Template | tmpl |
| std::string | name |
| std::string | why |
| std::vector< int > | eos_ids |
| std::vector< int > | turn_ids |
| int | tool_call_id = -1 |
Definition at line 53 of file chat_tokenizer.h.
Definition at line 94 of file chat_tokenizer.h.
|
inlinestatic |
Definition at line 61 of file chat_tokenizer.h.
References j, microtorch::chat::Template::name, tmpl, ember::token_id(), v, and why.
Referenced by ember::make_chat_setup().
|
inline |
Definition at line 119 of file chat_tokenizer.h.
References microtorch::chat::from_pairs(), j, microtorch::chat::render(), and tmpl.
|
inline |
|
inline |
Definition at line 107 of file chat_tokenizer.h.
References microtorch::chat::Template::assistant_close, microtorch::chat::Template::assistant_open, microtorch::chat::Template::bos, microtorch::chat::Template::content, microtorch::chat::Template::generation_prompt, microtorch::chat::Template::name, microtorch::chat::Template::stop_eos, microtorch::chat::Template::stop_turn, microtorch::chat::Template::system_mode, tmpl, microtorch::chat::Template::user_close, microtorch::chat::Template::user_open, v, microtorch::chat::v1(), and microtorch::chat::Template::version.
| std::vector<int> ember::ChatFormat::eos_ids |
Definition at line 57 of file chat_tokenizer.h.
Referenced by is_eos(), main(), and stop_ids().
| std::string ember::ChatFormat::name |
Definition at line 55 of file chat_tokenizer.h.
| chat::Template ember::ChatFormat::tmpl |
Definition at line 54 of file chat_tokenizer.h.
Referenced by of(), prompt(), and v1_markers().
| int ember::ChatFormat::tool_call_id = -1 |
Definition at line 58 of file chat_tokenizer.h.
| std::vector<int> ember::ChatFormat::turn_ids |
Definition at line 57 of file chat_tokenizer.h.
Referenced by is_stop(), and stop_ids().
| std::string ember::ChatFormat::why |
Definition at line 56 of file chat_tokenizer.h.
Referenced by of().