feat: implement a basic tokenizer

This commit is contained in:
2026-10-27 19:58:15 +01:00
parent fa0418914a
commit 806652fd86
3 changed files with 278 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
#include "tokenizer.hpp"
#include <cstdio>
int main(void) {
// static constexpr const char* filepath = "./gpt-training.txt";
tokenizer<259> bpe;
bpe.train("abcabcd");
auto tokens = bpe.encode("abc");
for (auto tok : tokens) {
std::printf("0x%08X\n", tok); // NOLINT
}
return 0;
}