fix: trailing whitespace

This commit is contained in:
M. Yusuf Sarıgöz 2023-10-08 15:38:47 +03:00
parent 204d08be3d
commit 95da79e740
2 changed files with 18 additions and 24 deletions

View file

@ -233,7 +233,6 @@ struct clip_ctx {
struct gguf_context * ctx_gguf;
//struct clip_buffer buf_compute;
// reusable buffer for `struct ggml_graph_plan.work_data`
std::vector<uint8_t> work_buffer;
@ -285,7 +284,6 @@ static ggml_cgraph * clip_image_build_graph(const clip_ctx * ctx, const clip_ima
struct ggml_context * ctx0 = ggml_init(params);
struct ggml_cgraph * gf = ggml_new_graph(ctx0);
struct ggml_tensor * inp_raw = ggml_new_tensor_4d(ctx0, GGML_TYPE_F32, image_size, image_size, 3, batch_size);
ggml_allocr_alloc(ctx->alloc, inp_raw);

View file

@ -144,16 +144,13 @@ const char * sample(struct llama_context * ctx_llama, gpt_params & params, int *
int main(int argc, char ** argv) {
gpt_params params;
if (argc < 3) {
printf("usage: %s <path/to/llava-rlhf-qe_k.gguf> <path/to/llava-encoder-f16.gguf> [path/to/an/image.jpg] [a text prompt]\n", argv[0]);
if (argc < 4) {
printf("usage: %s <path/to/llava-v1.5/ggml-model-f16.gguf> <path/to/llava-v1.5/llava-encoder-f16.gguf> <path/to/an/image.jpg> [a text prompt]\n", argv[0]);
}
params.model = argv[1];
const char * clip_path = argv[2];
const char * img_path;
if (argc >= 4) {
img_path = argv[3];
}
const char * img_path = argv[3];
if (argc >= 5) {
params.prompt = argv[4];
@ -163,8 +160,7 @@ int main(int argc, char ** argv) {
params.prompt = "describe the image in detail.";
}
auto ctx_clip = clip_model_load(clip_path, 3);
auto ctx_clip = clip_model_load(clip_path, 1);
clip_image_u8 img;
clip_image_f32 img_res;
clip_image_load_from_file(img_path, &img);