whitespace corrections
This commit is contained in:
parent
37a147ebf9
commit
7dcadb4ec3
5 changed files with 46 additions and 50 deletions
|
@ -1,7 +1,6 @@
|
|||
// NOTE: This is modified from clip.cpp only for LLaVA,
|
||||
// so there might be still unnecessary artifacts hanging around
|
||||
// I'll gradually clean and extend it
|
||||
|
||||
#include "clip.h"
|
||||
#include "ggml.h"
|
||||
#include "ggml-alloc.h"
|
||||
|
@ -1803,7 +1802,6 @@ bool clip_model_quantize(const char * fname_inp, const char * fname_out, const i
|
|||
|
||||
auto * ctx_clip = clip_model_load(fname_inp, 2);
|
||||
|
||||
|
||||
const auto & ctx_src = ctx_clip->ctx_gguf;
|
||||
const auto & ctx_data = ctx_clip->ctx_data;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import os
|
|||
import torch
|
||||
from safetensors.torch import load as safe_load, save as safe_save, safe_open, save_file
|
||||
|
||||
|
||||
# Function to determine if file is a SafeTensor file
|
||||
def is_safetensor_file(file_path):
|
||||
return file_path.endswith('.safetensors')
|
||||
|
|
|
@ -26,7 +26,7 @@ static bool handle_patches(clip_ctx * ctx_clip, std::vector<float *> & image_emb
|
|||
size_t ctx_size = 0;
|
||||
{
|
||||
ctx_size += clip_embd_nbytes(ctx_clip) * image_embd_v.size() * 8; // image_features
|
||||
ctx_size += 1024*1024 * ggml_type_size(GGML_TYPE_F32); //
|
||||
ctx_size += 1024*1024 * ggml_type_size(GGML_TYPE_F32);
|
||||
}
|
||||
|
||||
struct ggml_init_params params {
|
||||
|
@ -113,7 +113,7 @@ static bool handle_patches(clip_ctx * ctx_clip, std::vector<float *> & image_emb
|
|||
// struct ggml_tensor *dummy = ggml_new_tensor_4d(ctx_noalloc, GGML_TYPE_F32, num_patches_height, num_patches_width, num_patches_per_side, num_patches_per_side * clip_n_mmproj_embd(ctx_clip));
|
||||
|
||||
struct ggml_tensor *image_features_view = ggml_view_4d(model.ctx, image_features,
|
||||
num_patches_height, // nb0 : 4 byte für jedes
|
||||
num_patches_height,
|
||||
num_patches_width,
|
||||
num_patches_per_side * num_patches_per_side,
|
||||
clip_n_mmproj_embd(ctx_clip),
|
||||
|
@ -174,7 +174,6 @@ static bool handle_patches(clip_ctx * ctx_clip, std::vector<float *> & image_emb
|
|||
// *n_img_pos_out=576;
|
||||
|
||||
ggml_free(model.ctx);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue