fixed rwkv, standardized new ctx usage

This commit is contained in:
Concedo 2023-07-10 20:05:53 +08:00
parent 2827920044
commit 523fc3be52
8 changed files with 27 additions and 8 deletions

View file

@ -221,4 +221,16 @@ bool should_transpose_layer(std::string name)
return true;
}
return false;
}
static std::vector<uint8_t> kcpp_compute_buf;
void kcpp_graph_compute_helper(ggml_cgraph *graph, int n_threads)
{
struct ggml_cplan plan = ggml_graph_plan(graph, n_threads);
if (plan.work_size > 0)
{
kcpp_compute_buf.resize(plan.work_size);
plan.work_data = kcpp_compute_buf.data();
}
ggml_graph_compute(graph, &plan);
}