-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathcodellama.cpp
More file actions
28 lines (24 loc) · 918 Bytes
/
Copy pathcodellama.cpp
File metadata and controls
28 lines (24 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "codellama.h"
namespace chatllm::codellama
{
Tokenizer::Tokenizer(const Config &config)
: llama::v2::Tokenizer::Tokenizer(config)
{
sys_prompt = "";
}
ConditionalGeneration::ConditionalGeneration(const Config &config, const RuntimeConfig &runtime_config)
: ConditionalGeneration(config, runtime_config, MODEL_TYPE_CODELLAMA)
{
}
ConditionalGeneration::ConditionalGeneration(const Config &config, const RuntimeConfig &runtime_config, ModelType type)
: llama::v2::ConditionalGeneration(config, runtime_config, type)
{
auto transformer = Base::get_typed_transformer<ModelClass>();
for (int i = 0; i < config.num_hidden_layers; i++)
{
auto &attention = transformer->layers[i].attention;
attention.freq_base = config.rope_theta;
}
}
REGISTER_MODEL_LOADER(CODELLAMA, codellama, 1);
}