Ollama AssistentChat BagFix
This commit is contained in:
1 parent
18ca22aafc
commit
bc582893cc
47 files changed
+3149
-25066
No files matched your search
@@ -111,4 +111,26 @@ void proccesing_promt(const std::string& text, Model& mdl, uint32_t layer_idx)
|
||||
}
|
||||
mdl.ctx_len++;
|
||||
}
|
||||
}
|
||||
|
||||
Model create_test_model() {
|
||||
Model model;
|
||||
model.config.magic = 0x31524642; // "BFR1"
|
||||
model.config.vocab_size = TEST_VOCAB_SIZE;
|
||||
model.config.embedding_dim = TEST_EMBEDDING_DIM;
|
||||
model.config.num_heads = TEST_NUM_HEADS;
|
||||
model.config.head_dim = TEST_HEAD_DIM;
|
||||
model.config.num_layers = TEST_NUM_LAYERS;
|
||||
model.config.max_ctx = TEST_MAX_CTX;
|
||||
model.vocab = TEST_VOCAB;
|
||||
size_t emb_elements = TEST_VOCAB_SIZE * TEST_EMBEDDING_DIM;
|
||||
size_t qkv_elements = TEST_NUM_LAYERS * TEST_EMBEDDING_DIM * 3 * TEST_NUM_HEADS;
|
||||
size_t o_elements = TEST_NUM_LAYERS * (TEST_NUM_HEADS * TEST_HEAD_DIM) * TEST_EMBEDDING_DIM;
|
||||
const float* emb_ptr = reinterpret_cast<const float*>(TEST_W_EMB);
|
||||
model.w_emb = std::vector<float>(emb_ptr, emb_ptr + emb_elements);
|
||||
const float* qkv_ptr = reinterpret_cast<const float*>(TEST_W_QKV);
|
||||
model.w_qkv = std::vector<float>(qkv_ptr, qkv_ptr + qkv_elements);
|
||||
const float* o_ptr = reinterpret_cast<const float*>(TEST_W_O);
|
||||
model.w_o = std::vector<float>(o_ptr, o_ptr + o_elements);
|
||||
return model;
|
||||
}
|
||||
Reference in new issue
Block a user