undo complicated printing until its fixed sadly
This commit is contained in:
parent
ee36313770
commit
703571861f
1 changed files with 22 additions and 13 deletions
35
main.cpp
35
main.cpp
|
@ -951,20 +951,29 @@ int main(int argc, char ** argv) {
|
|||
|
||||
// display text
|
||||
if (!input_noecho) {
|
||||
std::string check = processor.IdToPiece(all_tokens.at(all_tokens.size()-1));
|
||||
if(check != "<EFBFBD>") { // ensure a multi-byte token is finished generating before outputting the text
|
||||
std::string text;
|
||||
processor.Decode(all_tokens, &text);
|
||||
std::string chunk = text.substr(full_text.length());
|
||||
printf("%s", chunk.c_str());
|
||||
full_text += chunk;
|
||||
|
||||
// std::string check = processor.IdToPiece(all_tokens.at(all_tokens.size()-1));
|
||||
// printf("[%s]", check.c_str());
|
||||
// if(check != "<22>") { // ensure a multi-byte token is finished generating before outputting the text
|
||||
// std::string text;
|
||||
// processor.Decode(all_tokens, &text);
|
||||
// std::string chunk = text.substr(full_text.length());
|
||||
// printf("%s", chunk.c_str());
|
||||
// full_text.reserve (text.size());
|
||||
// full_text += chunk;
|
||||
|
||||
// reset color to default if we there is no pending user input
|
||||
if (params.use_color && embd_inp.size() <= input_consumed) {
|
||||
printf(ANSI_COLOR_RESET);
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
// // reset color to default if we there is no pending user input
|
||||
// if (params.use_color && embd_inp.size() <= input_consumed) {
|
||||
// printf(ANSI_COLOR_RESET);
|
||||
// }
|
||||
// fflush(stdout);
|
||||
// }
|
||||
|
||||
// The code above crashes and is WIP any help appreciated
|
||||
std::string text;
|
||||
processor.Decode(all_tokens, &text);
|
||||
printf("%s\n", text.c_str());
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
// in interactive mode, and not currently processing queued inputs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue