technician1 commited on
Commit
285503e
·
verified ·
1 Parent(s): 406f98e

Upload 2 files

Browse files
Files changed (2) hide show
  1. ChatIPC.cpp +2 -1
  2. ChatIPC.exe +1 -1
ChatIPC.cpp CHANGED
@@ -388,6 +388,7 @@ static std::vector<std::string> generate_response(KnowledgeBase &kb,
388
  resp.push_back(only);
389
  recent_counts[only] += 1;
390
  last_printed = only;
 
391
  continue;
392
  }
393
 
@@ -401,6 +402,7 @@ static std::vector<std::string> generate_response(KnowledgeBase &kb,
401
  resp.push_back(chosen);
402
  recent_counts[chosen] += 1;
403
  last_printed = chosen;
 
404
  }
405
  return resp;
406
  }
@@ -640,7 +642,6 @@ int main(int argc, char **argv){
640
  for (size_t i=1;i<prompt_toks.size();++i) kb.add_pair(prompt_toks[i-1], prompt_toks[i]);
641
  auto def_index = snapshot_def_index(kb);
642
  auto resp = generate_response(kb, prompt_toks, maxlen, def_index, repeat_penalty);
643
- for (size_t i=0;i<resp.size();++i){ std::cout << resp[i]; if (i+1<resp.size()) std::cout << ' '; }
644
  std::cout << "\n";
645
  if (!resp.empty()){
646
  std::vector<std::string> combined = prompt_toks;
 
388
  resp.push_back(only);
389
  recent_counts[only] += 1;
390
  last_printed = only;
391
+ std::cout << only << ' ' << std::flush; // print immediately
392
  continue;
393
  }
394
 
 
402
  resp.push_back(chosen);
403
  recent_counts[chosen] += 1;
404
  last_printed = chosen;
405
+ std::cout << chosen << ' ' << std::flush; // print immediately
406
  }
407
  return resp;
408
  }
 
642
  for (size_t i=1;i<prompt_toks.size();++i) kb.add_pair(prompt_toks[i-1], prompt_toks[i]);
643
  auto def_index = snapshot_def_index(kb);
644
  auto resp = generate_response(kb, prompt_toks, maxlen, def_index, repeat_penalty);
 
645
  std::cout << "\n";
646
  if (!resp.empty()){
647
  std::vector<std::string> combined = prompt_toks;
ChatIPC.exe CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:cebe8014f2651597ff43d04dc0a27089ada505868be13eda19ce52089baafc8b
3
  size 24027648
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20c7e56c319bdfa3c497438bb1d67713433580c891fdb300deed3b7f0f874f60
3
  size 24027648