MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / load_hift_linear

Function load_hift_linear

src/models/chatterbox/hift_vocoder_impl.cpp:58–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57 auto weights = std::make_shared<HiFTVocoderComponentWeights>();
58 weights->runtime_weights = state->component.weights();
59 HiFTVocoderComponent component(std::move(weights), execution_context);
60 component.state_ = std::move(state);
61 return component;
62}
63
64HiFTVocoderComponent::HiFTVocoderComponent(
65 std::shared_ptr<const HiFTVocoderComponentWeights> weights,
66 const engine::core::ExecutionContext & execution_context)
67 : weights_(std::move(weights)), execution_context_(&execution_context) {}
68
69const engine::core::BackendConfig & HiFTVocoderComponent::backend() const noexcept {
70 return execution_context_->config();
71}
72
73const std::shared_ptr<const HiFTVocoderComponentWeights> & HiFTVocoderComponent::weights() const noexcept {
74 return weights_;
75}
76
77HiFTVocoderOutputs HiFTVocoderComponent::infer(
78 const std::vector<float> & speech_feat,
79 int64_t batch,
80 int64_t frames,
81 uint64_t seed,
82 uint64_t prior_noise_values,
83 const std::vector<float> & cache_source) const {

Callers 1

Calls 3

make_from_f32Method · 0.80
read_f32_tensorFunction · 0.70
make_f32Method · 0.45

Tested by

no test coverage detected