Skip to content

Commit 91c489e

Browse files
committed
Revert "arg: Skip mmproj download when user supplied mmproj (ggml-org#24239)"
This reverts commit 322feee.
1 parent 8e1845a commit 91c489e

1 file changed

Lines changed: 0 additions & 52 deletions

File tree

common/arg.cpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -434,58 +434,6 @@ static bool parse_bool_value(const std::string & value) {
434434
// CLI argument parsing functions
435435
//
436436

437-
bool common_params_handle_models(common_params & params, llama_example curr_ex) {
438-
const bool spec_type_draft_mtp = std::find(params.speculative.types.begin(),
439-
params.speculative.types.end(),
440-
COMMON_SPECULATIVE_TYPE_DRAFT_MTP) != params.speculative.types.end();
441-
442-
common_download_opts opts;
443-
opts.bearer_token = params.hf_token;
444-
opts.offline = params.offline;
445-
opts.skip_download = params.skip_download;
446-
opts.download_mtp = spec_type_draft_mtp;
447-
opts.download_mmproj = !params.no_mmproj && params.mmproj.path.empty() && params.mmproj.url.empty();
448-
449-
// sub-models (draft, mmproj, vocoder) are explicitly specified by the user,
450-
// so we should not auto-discover mtp/mmproj siblings for them
451-
common_download_opts sub_opts = opts;
452-
sub_opts.download_mtp = false;
453-
sub_opts.download_mmproj = false;
454-
455-
try {
456-
auto res = common_params_handle_model(params.model, opts);
457-
if (params.no_mmproj) {
458-
params.mmproj = {};
459-
} else if (res.found_mmproj && params.mmproj.path.empty() && params.mmproj.url.empty()) {
460-
// optionally, handle mmproj model when -hf is specified
461-
params.mmproj = res.mmproj;
462-
}
463-
// only download mmproj if the current example is using it
464-
for (const auto & ex : mmproj_examples) {
465-
if (curr_ex == ex) {
466-
common_params_handle_model(params.mmproj, sub_opts);
467-
break;
468-
}
469-
}
470-
471-
// when --spec-type mtp is set and no draft model was provided explicitly,
472-
// fall back to the MTP head discovered alongside the -hf model
473-
if (spec_type_draft_mtp && res.found_mtp &&
474-
params.speculative.draft.mparams.path.empty() &&
475-
params.speculative.draft.mparams.hf_repo.empty() &&
476-
params.speculative.draft.mparams.url.empty()) {
477-
params.speculative.draft.mparams.path = res.mtp.path;
478-
}
479-
common_params_handle_model(params.speculative.draft.mparams, sub_opts);
480-
common_params_handle_model(params.vocoder.model, sub_opts);
481-
return true;
482-
} catch (const common_skip_download_exception &) {
483-
return false;
484-
} catch (const std::exception &) {
485-
throw;
486-
}
487-
}
488-
489437
static bool common_params_parse_ex(int argc, char ** argv, common_params_context & ctx_arg) {
490438
common_params & params = ctx_arg.params;
491439

0 commit comments

Comments
 (0)