Skip to content

Commit b47e68e

Browse files
committed
happy CI
1 parent d39cc2e commit b47e68e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

convert_hf_to_gguf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8312,10 +8312,10 @@ def set_gguf_parameters(self):
83128312
super().set_gguf_parameters()
83138313
self.gguf_writer.add_clip_projector_type(gguf.VisionProjectorType.LFM2)
83148314
self.gguf_writer.add_vision_attention_layernorm_eps(self.find_vparam(["layer_norm_eps"]))
8315-
self.gguf_writer.add_vision_projector_scale_factor(self.global_config.get("downsample_factor"))
8315+
self.gguf_writer.add_vision_projector_scale_factor(self.global_config.get("downsample_factor", 2))
83168316
self.gguf_writer.add_vision_use_gelu(True)
83178317
# python notation, e.g. for vision_feature_layer == -1, we pick last layer -> vision_feature_layers_to_drop = 0
8318-
vision_feature_layers_to_drop = -(self.global_config.get("vision_feature_layer") + 1)
8318+
vision_feature_layers_to_drop = -(self.global_config.get("vision_feature_layer", -1) + 1)
83198319
self.gguf_writer.add_vision_block_count(self.find_vparam(self.n_block_keys) - vision_feature_layers_to_drop)
83208320

83218321
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:

tools/mtmd/clip.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3519,8 +3519,8 @@ bool clip_image_preprocess(struct clip_ctx * ctx, const clip_image_u8 * img, str
35193519
const float max_pixels = max_image_tokens * total_factor * total_factor;
35203520

35213521
auto round_by_factor = [f = total_factor](float x) { return static_cast<int>(std::nearbyintf(x / static_cast<float>(f))) * f; };
3522-
auto ceil_by_factor = [f = total_factor](float x) { return static_cast<int>(std::ceilf(x / static_cast<float>(f))) * f; };
3523-
auto floor_by_factor = [f = total_factor](float x) { return static_cast<int>(std::floorf(x / static_cast<float>(f))) * f; };
3522+
auto ceil_by_factor = [f = total_factor](float x) { return static_cast<int>(std::ceil(x / static_cast<float>(f))) * f; };
3523+
auto floor_by_factor = [f = total_factor](float x) { return static_cast<int>(std::floor(x / static_cast<float>(f))) * f; };
35243524

35253525
int h_bar = std::max(total_factor, round_by_factor(height));
35263526
int w_bar = std::max(total_factor, round_by_factor(width));

0 commit comments

Comments
 (0)