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

Method check_model

src/pull/model_downloader.cpp:411–430  ·  view source on GitHub ↗

\brief Check hash of model files \param model_tag the model tag \return true if all files are present and compatible, false otherwise

Source from the content-addressed store, hash-verified

409/// \param model_tag the model tag
410/// \return true if all files are present and compatible, false otherwise
411bool ModelDownloader::check_model(const std::string& model_tag, bool sub_process_mode) {
412 auto [new_model_tag, model_info] = supported_models.get_model_info(model_tag);
413 header_print("FLM", "Checking model: " + new_model_tag + "...\n");
414
415 if (!is_model_downloaded(new_model_tag, sub_process_mode)) {
416 header_print("FLM", "Model not exist or not compatible: " + new_model_tag);
417 header_print("FLM", "Please use `flm pull " + new_model_tag + "` to download the model.");
418 return true;
419 }
420 else {
421 bool ok = verify_and_clean_files(new_model_tag, sub_process_mode);
422 if (!ok) {
423 header_print("FLM", "Model check completed with errors. Please use `flm pull " + new_model_tag + "` to re-download corrupted files.");
424 }
425 else {
426 header_print("FLM", "Model check completed successfully. All files are present and compatible.");
427 }
428 }
429 return true;
430}
431
432/// \brief Verify each model file's hash against HuggingFace metadata and
433/// remove any corrupted files. Files that pass verification are kept.

Callers 1

mainFunction · 0.80

Calls 1

get_model_infoMethod · 0.80

Tested by

no test coverage detected