Skip to content

Commit 7ea8d80

Browse files
authored
llava : the function "clip" should be int (#9237)
1 parent 42c76d1 commit 7ea8d80

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

examples/llava/clip.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ static void normalize_image_u8_to_f32(const clip_image_u8* src, clip_image_f32*
16231623
}
16241624
}
16251625

1626-
inline float clip(float x, float lower, float upper) {
1626+
inline int clip(int x, int lower, int upper) {
16271627
return std::max(lower, std::min(x, upper));
16281628
}
16291629

@@ -1827,10 +1827,6 @@ static std::pair<int, int> uhd_get_refine_size(std::pair<int, int> original_size
18271827
return refine_size;
18281828
}
18291829

1830-
inline int clip(int x, int lower, int upper) {
1831-
return std::max(lower, std::min(x, upper));
1832-
}
1833-
18341830
static std::pair<int, int> uhd_best_grid(const int max_slice_nums, const int multiple, const float log_ratio) {
18351831
std::vector<int> candidate_split_grids_nums;
18361832
for (int i : {multiple - 1, multiple, multiple + 1}) {

0 commit comments

Comments
 (0)