Skip to content

Commit

Permalink
llava : the function "clip" should be int (ggerganov#9237)
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-mb authored and arthw committed Nov 18, 2024
1 parent 09aea3c commit b086ab8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions examples/llava/clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down Expand Up @@ -1827,10 +1827,6 @@ static std::pair<int, int> uhd_get_refine_size(std::pair<int, int> 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<int, int> uhd_best_grid(const int max_slice_nums, const int multiple, const float log_ratio) {
std::vector<int> candidate_split_grids_nums;
for (int i : {multiple - 1, multiple, multiple + 1}) {
Expand Down

0 comments on commit b086ab8

Please sign in to comment.