Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions cactus-engine/src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ bool Model::load_manifest() {
return "";
};
image_preprocess_strategy_ = read_string_key("media_image_preprocess_strategy");
if (image_preprocess_strategy_.empty() && family_ == "lfm2_vl") image_preprocess_strategy_ = "lfm2_vl";
audio_preprocess_strategy_ = read_string_key("media_audio_preprocess_strategy");
media_injection_strategy_ = read_string_key("media_injection_strategy");
media_prefill_fallback_ = read_string_key("media_prefill_fallback");
Expand Down Expand Up @@ -2098,17 +2099,9 @@ size_t sequence_length_from_shape(const std::vector<size_t>& shape) {

void set_sequence_length_in_shape(std::vector<size_t>& shape, size_t sequence_length) {
if (shape.empty()) return;
if (shape.size() >= 2 && shape[0] == 1 && shape[1] == 1) {
shape[1] = sequence_length;
return;
}
if (shape.size() >= 2 && shape[shape.size() - 2] == 1) {
shape[shape.size() - 2] = sequence_length;
return;
}
if (shape.size() == 1 && shape[0] == 1) {
shape[0] = sequence_length;
}
if (shape.size() >= 2 && shape[0] == 1) shape[1] = sequence_length;
else if (shape.size() >= 2) shape[shape.size() - 2] = sequence_length;
else shape[0] = sequence_length;
}

std::string Model::image_preprocess_strategy() const {
Expand Down
Loading