Skip to content

Commit

Permalink
change n_layer
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-mb committed Jun 25, 2024
1 parent 8f03505 commit e68c8bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/llava/clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ static ggml_cgraph * clip_image_build_graph(clip_ctx * ctx, const clip_image_f32
const int hidden_size = hparams.hidden_size;
const int n_head = hparams.n_head;
const int d_head = hidden_size / n_head;
const int n_layer = hparams.n_layer;
int n_layer = hparams.n_layer;
const float eps = hparams.eps;

const int batch_size = imgs->size;
Expand Down Expand Up @@ -647,7 +647,10 @@ static ggml_cgraph * clip_image_build_graph(clip_ctx * ctx, const clip_image_f32
}

// loop over layers
for (int il = 0; il < n_layer; il++) {
if (ctx->has_minicpmv_projector){
n_layer += 1;
}
for (int il = 0; il < n_layer-1; il++) {
struct ggml_tensor * cur = embeddings; // embeddings = residual, cur = hidden_states

//const size_t nb_q_w = model.layers[il].q_w->nb[0];
Expand Down

0 comments on commit e68c8bc

Please sign in to comment.