Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix compile
  • Loading branch information
ngxson committed May 25, 2025
commit bb92d1d0077b9fc90f6aa0b97e91fa9e03ac7ada
2 changes: 1 addition & 1 deletion convert_hf_to_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ def __init__(self, *args, **kwargs):
self.global_config = copy.deepcopy(self.hparams)
self.hparams_vision = self.get_vision_config()
self.hparams_audio = self.get_audio_config()

if self.hparams_vision is None and self.hparams_audio is None:
raise ValueError("vision_config / audio_config not found in hparams")

Expand Down
2 changes: 1 addition & 1 deletion tools/mtmd/clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2672,7 +2672,7 @@ struct clip_model_loader {
}
};

std::pair<clip_ctx *, clip_ctx *> clip_init(const char * fname, struct clip_context_params ctx_params) {
struct clip_init_result clip_init(const char * fname, struct clip_context_params ctx_params) {
g_logger_state.verbosity_thold = ctx_params.verbosity;
clip_ctx * ctx_vision = nullptr;
clip_ctx * ctx_audio = nullptr;
Expand Down
8 changes: 6 additions & 2 deletions tools/mtmd/clip.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ struct clip_context_params {
enum ggml_log_level verbosity;
};

// returns pair of <vision, audio> contexts
std::pair<clip_ctx *, clip_ctx *> clip_init(const char * fname, struct clip_context_params ctx_params);
struct clip_init_result {
struct clip_ctx * ctx_v; // vision context
struct clip_ctx * ctx_a; // audio context
};

struct clip_init_result clip_init(const char * fname, struct clip_context_params ctx_params);

void clip_free(struct clip_ctx * ctx);

Expand Down
4 changes: 2 additions & 2 deletions tools/mtmd/mtmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ struct mtmd_context {
ctx_clip_params.use_gpu = ctx_params.use_gpu;
ctx_clip_params.verbosity = ctx_params.verbosity;
auto res = clip_init(mmproj_fname, ctx_clip_params);
ctx_v = res.first;
ctx_a = res.second;
ctx_v = res.ctx_v;
ctx_a = res.ctx_a;
if (!ctx_v && !ctx_a) {
throw std::runtime_error(string_format("Failed to load CLIP model from %s\n", mmproj_fname));
}
Expand Down