mirror of https://github.com/google/gemma.cpp.git
Inline the ctor of `GemmaChatTemplate`
This commit is contained in:
parent
d1615b56b2
commit
c39295f497
|
|
@ -114,10 +114,6 @@ bool GemmaTokenizer::Decode(const std::vector<int>& ids,
|
|||
return impl_->Decode(ids, detokenized);
|
||||
}
|
||||
|
||||
GemmaChatTemplate::GemmaChatTemplate(const GemmaTokenizer& tokenizer) {
|
||||
Init(tokenizer);
|
||||
}
|
||||
|
||||
void GemmaChatTemplate::Init(const GemmaTokenizer& tokenizer) {
|
||||
sot_user_.reserve(3);
|
||||
HWY_ASSERT(tokenizer.Encode("<start_of_turn>user\n", &sot_user_));
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ class GemmaTokenizer {
|
|||
class GemmaChatTemplate {
|
||||
public:
|
||||
GemmaChatTemplate() = default;
|
||||
explicit GemmaChatTemplate(const GemmaTokenizer& tokenizer);
|
||||
explicit GemmaChatTemplate(const GemmaTokenizer& tokenizer) {
|
||||
Init(tokenizer);
|
||||
}
|
||||
|
||||
void Init(const GemmaTokenizer& tokenizer);
|
||||
std::vector<int> Apply(size_t pos, const std::vector<int>& ids) const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue