voice_audio_multi/include/engine/models/vibevoice/lora.h
Fabio c36510c21e
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
Initial import: audio.cpp with Orange Pi documentation
2026-11-04 19:05:22 +01:00

29 lines
1.3 KiB
C++

#pragma once
#include "engine/framework/assets/tensor_source.h"
#include "engine/models/vibevoice/assets.h"
#include <filesystem>
#include <memory>
#include <string>
#include <unordered_map>
namespace engine::models::vibevoice {
// Overlays a fine-tune adapter directory onto a base weight source: the language-model LoRA is
// delta-merged into the decoder linears, and the diffusion head and acoustic/semantic connectors
// (when present) fully replace their base tensors. Mirrors infer.py's apply_lora.
std::shared_ptr<const assets::TensorSource> make_vibevoice_finetune_source(
std::shared_ptr<const assets::TensorSource> base,
const std::filesystem::path & adapter_path,
float scale_override);
// Applies the fine-tune adapter selected by the vibevoice.lora / vibevoice.lora_scale options,
// returning assets whose model_weights carry the overlay (and fine_tune_applied set). Returns the
// input unchanged when no vibevoice.lora option is present; throws if an adapter was already
// applied (guards against passing it via both --load-option and --session-option).
std::shared_ptr<const VibeVoiceAssets> apply_vibevoice_finetune_options(
std::shared_ptr<const VibeVoiceAssets> assets,
const std::unordered_map<std::string, std::string> & options);
} // namespace engine::models::vibevoice