| 12 | // to avoid pulling json dependencies into the main file_utils.cpp |
| 13 | |
| 14 | std::string FileUtils::GetConfigPath(const std::string& model_id) { |
| 15 | // Get current configuration |
| 16 | auto& config_mgr = mnncli::ConfigManager::GetInstance(); |
| 17 | auto config = config_mgr.LoadConfig(); |
| 18 | |
| 19 | mnn::downloader::Config downloader_config; |
| 20 | // Manual mapping or just pass what's needed. |
| 21 | // Actually FileUtils::GetConfigPath(model_id, config) takes mnn::downloader::Config |
| 22 | // We need to convert mnncli::Config to mnn::downloader::Config if explicit conversion is missing. |
| 23 | // Or just use kCachePath directly? |
| 24 | // The library implementation uses GetConfigPath(model_id, config). |
| 25 | // Let's implement it using kCachePath/default if possible, |
| 26 | // OR map the config. |
| 27 | |
| 28 | // Simplest: just map the relevant fields |
| 29 | downloader_config.cache_dir = config.cache_dir; // Assuming compatible |
| 30 | downloader_config.download_provider = config.download_provider; |
| 31 | |
| 32 | // Use the overloaded version with config parameter |
| 33 | return GetConfigPath(model_id, downloader_config); |
| 34 | } |
| 35 | |
| 36 | } // namespace mnn::downloader |
nothing calls this directly
no test coverage detected