From: tc-mb Date: Fri, 30 Aug 2024 05:21:57 +0000 (+0800) Subject: llava : the function "clip" should be int (#9237) X-Git-Tag: upstream/0.0.4488~842 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=7ea8d80d53364f2cdcd7bbc0f031106f529b1fe3;p=pkg%2Fggml%2Fsources%2Fllama.cpp llava : the function "clip" should be int (#9237) --- diff --git a/examples/llava/clip.cpp b/examples/llava/clip.cpp index 10e8765b..9b890571 100644 --- a/examples/llava/clip.cpp +++ b/examples/llava/clip.cpp @@ -1623,7 +1623,7 @@ static void normalize_image_u8_to_f32(const clip_image_u8* src, clip_image_f32* } } -inline float clip(float x, float lower, float upper) { +inline int clip(int x, int lower, int upper) { return std::max(lower, std::min(x, upper)); } @@ -1827,10 +1827,6 @@ static std::pair uhd_get_refine_size(std::pair original_size return refine_size; } -inline int clip(int x, int lower, int upper) { - return std::max(lower, std::min(x, upper)); -} - static std::pair uhd_best_grid(const int max_slice_nums, const int multiple, const float log_ratio) { std::vector candidate_split_grids_nums; for (int i : {multiple - 1, multiple, multiple + 1}) {