Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Jun 26, 2023
1 parent dffd07e commit 2a606f2
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions examples/sam/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ bool sam_encode_image(
}

// TODO: avoid copy
cur = ggml_cpy(state.ctx, cur, state.embd_img);
//cur = ggml_cpy(state.ctx, cur, state.embd_img);

ggml_set_name(cur, "check");

Expand Down Expand Up @@ -960,7 +960,6 @@ bool sam_encode_image(
sum += data[i];
}
printf("sum: %f\n", sum);
exit(0);
};

auto print_t_f16 = [&](struct ggml_tensor * t) {
Expand All @@ -983,7 +982,6 @@ bool sam_encode_image(
sum += ggml_fp16_to_fp32(data[i]);
}
printf("sum: %f\n", sum);
exit(0);
};

auto * t = ggml_get_tensor(ctx0, "check");
Expand Down Expand Up @@ -1129,7 +1127,6 @@ bool sam_encode_prompt(
sum += data[i];
}
printf("sum: %f\n", sum);
exit(0);
};

auto print_t_f16 = [&](struct ggml_tensor * t) {
Expand All @@ -1152,7 +1149,6 @@ bool sam_encode_prompt(
sum += ggml_fp16_to_fp32(data[i]);
}
printf("sum: %f\n", sum);
exit(0);
};

auto * t = ggml_get_tensor(ctx0, "check");
Expand Down Expand Up @@ -1230,10 +1226,10 @@ int main(int argc, char ** argv) {
t_load_us = ggml_time_us() - t_start_us;
}

//if (!sam_encode_image(model, img1, params.n_threads)) {
// fprintf(stderr, "%s: failed to encode image\n", __func__);
// return 1;
//}
if (!sam_encode_image(model, model.state, img1, params.n_threads)) {
fprintf(stderr, "%s: failed to encode image\n", __func__);
return 1;
}

// TODO: user input
const sam_point pt = { 414.375f, 162.796875f, };
Expand Down

0 comments on commit 2a606f2

Please sign in to comment.