Skip to content

model model

GitHub Action edited this page Jul 9, 2026 · 1 revision

Constructors

model(class tokenizer &tokenizer, class embedder &embedder, std::vector<class block> &blocks, float learning_rate = 0.01)

Tokes the tokenizer, embedder, and blocks (as well as learning rate) as parameters and re-initializes them all.

model(class tokenizer &tokenizer, std::pair<std::filesystem::path, std::vector<std::pair<std::pair<std::filesystem::path, std::vector<std::filesystem::path>>, std::filesystem::path>>> inputFiles)

Reads saved model from the inputed filepaths, takes tokenizer as parameter.


Basic Info

A wrapper class that holds the entire model.

Instance Variables

Variable Type
tokenizer tokenizer
embedder embedder
blocks std::vector<block>
learning_rate float

Functions


Example

// Initializing a block
tokenizer tokenizer("vocab.txt");
embedder embedder("bestembedderever.bin");
std::vector<block> blocks = {{{128, 512, 128}, 128}};
model m(tokenizer, embedder, blocks);

Clone this wiki locally