We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0f88d7 commit d8ba205Copy full SHA for d8ba205
examples/embedding/embedding.cpp
@@ -12,7 +12,17 @@ static std::vector<std::string> split_lines(const std::string & s) {
12
std::string line;
13
std::vector<std::string> lines;
14
std::stringstream ss(s);
15
+ std::string original = "\\n";
16
+ std::string replacement = "\n";
17
while (std::getline(ss, line)) {
18
+ // we need to unescape double escaped newlines
19
+ size_t start_pos = 0;
20
+ while((start_pos = line.find(original, start_pos)) != std::string::npos) {
21
+ std::string new_prompt =
22
+
23
+ line.replace(start_pos, original.length(), replacement);
24
+ start_pos += replacement.length();
25
+ }
26
lines.push_back(line);
27
}
28
return lines;
0 commit comments