Some checks failed
Linux Build / Linux cpu (push) Has been cancelled
Linux Build / Linux cpu-clang (push) Has been cancelled
Linux Build / Linux vulkan (push) Has been cancelled
mac-build / macOS CPU (push) Has been cancelled
Nix Build / Nix (cpu) (push) Has been cancelled
Nix Build / Nix (vulkan) (push) Has been cancelled
windows-build / Windows CPU (push) Has been cancelled
44 lines
1.5 KiB
C++
44 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "engine/framework/package_manager/manager.h"
|
|
|
|
#include <filesystem>
|
|
#include <memory>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
namespace minitts::server {
|
|
|
|
// Runs model package work outside the request thread. Normal package downloads,
|
|
// inventory, version checks, cancellation, cleanup, and uninstall are native C++.
|
|
// Requests with explicit converter inputs retain the deprecated Python helper
|
|
// until those checkpoint-conversion workflows migrate to native tools.
|
|
class ModelInstaller {
|
|
public:
|
|
ModelInstaller(std::filesystem::path repository_root, std::filesystem::path models_root);
|
|
~ModelInstaller();
|
|
|
|
ModelInstaller(const ModelInstaller &) = delete;
|
|
ModelInstaller & operator=(const ModelInstaller &) = delete;
|
|
|
|
std::string start(
|
|
const std::string & package_id,
|
|
const std::string & source_file,
|
|
const std::string & output_file,
|
|
const std::string & source_directory,
|
|
const std::string & variant,
|
|
bool overwrite);
|
|
std::string status(const std::string & package_id = {}) const;
|
|
std::string package_sizes();
|
|
std::string stop(const std::string & package_id);
|
|
std::string clean_partial(const std::string & package_id);
|
|
std::string remove(const std::string & package_id);
|
|
std::optional<engine::package_manager::PackageInfo> package_info(const std::string & package_id) const;
|
|
bool has_active_jobs() const;
|
|
|
|
private:
|
|
struct State;
|
|
std::shared_ptr<State> state_;
|
|
};
|
|
|
|
} // namespace minitts::server
|