mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 09:15:18 +02:00
handle contractions correctly, bump defaults
This commit is contained in:
@@ -1425,8 +1425,9 @@ int kokoro_runner::generate(std::string prompt, struct tts_response * response,
|
||||
prompt = replace_any(prompt, ",;:", "--");
|
||||
prompt = replace_any(prompt, "\n", " ");
|
||||
kokoro_str_replace_all(prompt," - "," -- ");
|
||||
kokoro_str_replace_all(prompt,"he's ","he is ");
|
||||
kokoro_str_replace_all(prompt,"'s ","s ");
|
||||
kokoro_str_replace_all(prompt,"wasn't ","wasnt ");
|
||||
kokoro_str_replace_all(prompt,"n't ","nt ");
|
||||
std::string phonemized_prompt = phmzr->text_to_phonemes(prompt);
|
||||
// printf("\nRESULT: %s\n",phonemized_prompt.c_str());
|
||||
|
||||
|
||||
@@ -851,11 +851,15 @@ bool phonemizer::process_word(corpus* text, std::string* output, std::string wor
|
||||
size_t unaccented_size_difference = 0;
|
||||
|
||||
std::string foundstr = found_word_to_ipa(word);
|
||||
if(foundstr!="")
|
||||
if(foundstr!="") //do not use if its part of a contracted word
|
||||
{
|
||||
output->append(foundstr);
|
||||
text->size_pop(word.size());
|
||||
return true;
|
||||
std::string detected = text->next(word.size()+1);
|
||||
if(detected.back()!='\'')
|
||||
{
|
||||
output->append(foundstr);
|
||||
text->size_pop(word.size());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (has_accent) {
|
||||
|
||||
Reference in New Issue
Block a user