MCPcopy Create free account
hub / github.com/alibaba/MNN / GetConfigPath

Method GetConfigPath

apps/mnncli/src/file_utils_config.cpp:14–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12// to avoid pulling json dependencies into the main file_utils.cpp
13
14std::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

Callers

nothing calls this directly

Calls 1

LoadConfigMethod · 0.80

Tested by

no test coverage detected