Spaces:
Running
Running
Sam Pullara
commited on
talk-llama : improve quote and backtick handling (#1364)
Browse files* ISSUE-1329: replace " with ' so it doesn't try to execute code in backticks.
* Typo
* Update to keep possessives in the output
Closes the ' then puts a ' in quotes then reopens the ' to escape the ' characters.
examples/talk-llama/talk-llama.cpp
CHANGED
|
@@ -686,8 +686,8 @@ int main(int argc, char ** argv) {
|
|
| 686 |
}
|
| 687 |
}
|
| 688 |
|
| 689 |
-
text_to_speak = ::replace(text_to_speak, "
|
| 690 |
-
int ret = system((params.speak + " " + std::to_string(voice_id) + "
|
| 691 |
if (ret != 0) {
|
| 692 |
fprintf(stderr, "%s: failed to speak\n", __func__);
|
| 693 |
}
|
|
|
|
| 686 |
}
|
| 687 |
}
|
| 688 |
|
| 689 |
+
text_to_speak = ::replace(text_to_speak, "'", "'\"'\"'");
|
| 690 |
+
int ret = system((params.speak + " " + std::to_string(voice_id) + " '" + text_to_speak + "'").c_str());
|
| 691 |
if (ret != 0) {
|
| 692 |
fprintf(stderr, "%s: failed to speak\n", __func__);
|
| 693 |
}
|