Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/orpheus_model.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include "orpheus_model.h"

#include <array>

// These tokens and variables aren't defined in the Orpheus' model configuration but instead are defined inline in various python functions.
// As such, they are not discoverable so defining them as unconfigurable constants should be fine.
static constexpr std::array<std::string, 7> orpheus_voices = {"zoe", "zac","jess", "leo", "mia", "julia", "leah"};
static constexpr std::array<const char *, 7> orpheus_voices{"zoe", "zac","jess", "leo", "mia", "julia", "leah"};
static constexpr std::array<uint32_t, 2> orpheus_prepended_tokens = { 128259, 128000 };
static constexpr std::array<uint32_t, 4> orpheus_appended_tokens = { 128009, 128260, 128261, 128257 };

Expand Down
3 changes: 1 addition & 2 deletions src/phonemizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void word_phonemizer::add_rule(std::vector<std::string> keys, std::string phonem
phonemizer_rule * current_rule = nullptr;
for (int i = 0; i < keys.size(); i++) {
if (current_rule) {
if (current_rule->rules.find(keys[i]) == rules.end()) {
if (!current_rule->rules.contains(keys[i])) {
phonemizer_rule * nrule = new phonemizer_rule;
current_rule->rules[keys[i]] = nrule;
current_rule = nrule;
Expand Down Expand Up @@ -1178,4 +1178,3 @@ struct phonemizer * phonemizer_from_file(const std::string fname, const std::str
}
return phonemizer_from_gguf(meta_ctx, espeak_voice_code);
}

3 changes: 2 additions & 1 deletion src/util.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef util_h
#define util_h

#define _USE_MATH_DEFINES
#include <cmath>
#include <functional>
#include <math.h>
#include <random>
#include <stdio.h>
#include <string>
Expand Down