Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2a11316

Browse files
committedSep 5, 2024·
temp
1 parent e9efef3 commit 2a11316

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
 

‎src/cpp/src/vision_encoder.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
using namespace ov::genai;
1111

1212
namespace {
13+
/// @brief A pair describing image size.
14+
struct HeightWidth {
15+
/// @brief Height of a corresponding image.
16+
size_t height;
17+
/// @brief Width of a corresponding image.
18+
size_t width;
19+
};
20+
1321
int ensure_divide(int length, int patch_size) {
1422
return std::max(static_cast<int>(std::round(static_cast<float>(length) / patch_size) * patch_size), patch_size);
1523
}

‎src/cpp/src/vlm_pipeline.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ struct Args {
2929
float repeat_penalty = 1.0f;
3030
};
3131

32+
/// @brief A pair describing image size.
33+
struct HeightWidth {
34+
/// @brief Height of a corresponding image.
35+
size_t height;
36+
/// @brief Width of a corresponding image.
37+
size_t width;
38+
};
39+
40+
3241
int64_t get_out_token_id(const std::vector<int>& input_ids, float* logits, size_t vocab_size, Args args) {
3342
int64_t out_token;
3443

0 commit comments

Comments
 (0)
Please sign in to comment.