Skip to content

Commit bb92d1d

Browse files
committed
fix compile
1 parent 2782a58 commit bb92d1d

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

convert_hf_to_gguf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ def __init__(self, *args, **kwargs):
11511151
self.global_config = copy.deepcopy(self.hparams)
11521152
self.hparams_vision = self.get_vision_config()
11531153
self.hparams_audio = self.get_audio_config()
1154-
1154+
11551155
if self.hparams_vision is None and self.hparams_audio is None:
11561156
raise ValueError("vision_config / audio_config not found in hparams")
11571157

tools/mtmd/clip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,7 @@ struct clip_model_loader {
26722672
}
26732673
};
26742674

2675-
std::pair<clip_ctx *, clip_ctx *> clip_init(const char * fname, struct clip_context_params ctx_params) {
2675+
struct clip_init_result clip_init(const char * fname, struct clip_context_params ctx_params) {
26762676
g_logger_state.verbosity_thold = ctx_params.verbosity;
26772677
clip_ctx * ctx_vision = nullptr;
26782678
clip_ctx * ctx_audio = nullptr;

tools/mtmd/clip.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ struct clip_context_params {
2929
enum ggml_log_level verbosity;
3030
};
3131

32-
// returns pair of <vision, audio> contexts
33-
std::pair<clip_ctx *, clip_ctx *> clip_init(const char * fname, struct clip_context_params ctx_params);
32+
struct clip_init_result {
33+
struct clip_ctx * ctx_v; // vision context
34+
struct clip_ctx * ctx_a; // audio context
35+
};
36+
37+
struct clip_init_result clip_init(const char * fname, struct clip_context_params ctx_params);
3438

3539
void clip_free(struct clip_ctx * ctx);
3640

tools/mtmd/mtmd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ struct mtmd_context {
150150
ctx_clip_params.use_gpu = ctx_params.use_gpu;
151151
ctx_clip_params.verbosity = ctx_params.verbosity;
152152
auto res = clip_init(mmproj_fname, ctx_clip_params);
153-
ctx_v = res.first;
154-
ctx_a = res.second;
153+
ctx_v = res.ctx_v;
154+
ctx_a = res.ctx_a;
155155
if (!ctx_v && !ctx_a) {
156156
throw std::runtime_error(string_format("Failed to load CLIP model from %s\n", mmproj_fname));
157157
}

0 commit comments

Comments
 (0)