MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / is_model_downloaded

Method is_model_downloaded

src/pull/model_downloader.cpp:23–44  ·  view source on GitHub ↗

\brief Check if the model is downloaded \param model_tag the model tag \return true if the model is downloaded, false otherwise

Source from the content-addressed store, hash-verified

21/// \param model_tag the model tag
22/// \return true if the model is downloaded, false otherwise
23bool ModelDownloader::is_model_downloaded(const std::string& model_tag, bool sub_process_mode, bool fast_check) {
24 auto missing_files = get_missing_files(model_tag);
25 bool is_config_file_missing = std::find(missing_files.begin(), missing_files.end(), "config.json") != missing_files.end();
26 if (!is_config_file_missing) {
27 if (!check_model_compatibility(model_tag, sub_process_mode)) {
28 if (!sub_process_mode)
29 header_print("FLM", "Model " + model_tag + " is not compatible with the current FLM version. ");
30 // Fast path: skip the expensive HF metadata fetch + per-file hash
31 // verification. Caller (e.g. `flm list`) only needs the boolean
32 // status; cleanup can happen later on `pull` / `check`.
33 if (fast_check) {
34 return false;
35 }
36 // Instead of removing all files wholesale, verify each file against
37 // HuggingFace metadata and remove only corrupted ones (same logic
38 // as check_model). Files that pass verification can be reused.
39 verify_and_clean_files(model_tag, sub_process_mode);
40 return false;
41 }
42 }
43 return missing_files.empty();
44}
45
46/// \brief Check if the model is compatible with the current FLM version
47/// \param model_tag the model tag

Callers 7

RunnerMethod · 0.80
runMethod · 0.80
cmd_loadMethod · 0.80
mainFunction · 0.80
ensure_model_loadedMethod · 0.80

Calls 4

findFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected