voice_audio_multi/include/engine/models/breeze_tts/tokenizer_text.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

44 lines
1.3 KiB
C++

#pragma once
#include "engine/models/breeze_tts/assets.h"
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
namespace engine::models::breeze_tts {
struct BreezePromptBranch {
std::vector<int32_t> input_ids;
std::vector<uint8_t> text_mask;
std::vector<int64_t> text_segment_lengths;
std::vector<std::vector<int32_t>> text_segments;
};
class BreezeTextTokenizer {
public:
explicit BreezeTextTokenizer(std::shared_ptr<const BreezeTTSAssets> assets);
~BreezeTextTokenizer();
BreezePromptBranch build_tts_instruction(const std::string & text, const std::string & instruction) const;
BreezePromptBranch build_tts_plain(const std::string & text) const;
BreezePromptBranch build_clone(
const std::string & text,
const std::string & instruction,
const std::string & reference_text,
int64_t reference_audio_frames) const;
BreezePromptBranch build_clone_negative(
const std::string & text,
const std::string & reference_text,
int64_t reference_audio_frames) const;
int32_t audio_token_id() const noexcept;
int32_t audio_eos_token_id() const noexcept;
private:
struct Impl;
std::unique_ptr<Impl> impl_;
};
} // namespace engine::models::breeze_tts