technician1 commited on
Commit
cb839f1
·
1 Parent(s): dc0463f

Upload ChatIPC.cpp

Browse files
Files changed (1) hide show
  1. ChatIPC.cpp +6 -6
ChatIPC.cpp CHANGED
@@ -1246,9 +1246,9 @@ int main(int argc, char **argv){
1246
  kb.set_def_depth(dict_depth);
1247
 
1248
  if (!load_kb.empty()){
1249
- try { std::cerr << "Loading KB: " << load_kb << "\n";
1250
- load_kb_binary(kb, load_kb, dict_depth); std::cerr << "Loaded KB: " << load_kb << "\n"; }
1251
- catch (const std::exception &e){ std::cerr << "Load KB error: " << e.what() << "\n"; }
1252
  }
1253
 
1254
  if (!learn_files.empty()){
@@ -1266,9 +1266,9 @@ int main(int argc, char **argv){
1266
  std::cout << "\n";
1267
  if (!resp.empty()){for (size_t i=1;i<resp.size();++i) kb.add_pair(resp[i-1], resp[i]);}
1268
  if (!savefile.empty()){
1269
- try { std::cerr << "Saving KB: " << savefile << "\n";
1270
- save_kb_binary(kb, savefile); std::cerr << "Saved KB: " << savefile << "\n"; }
1271
- catch (const std::exception &e){ std::cerr << "Save KB error: " << e.what() << "\n"; }
1272
  }
1273
  }
1274
 
 
1246
  kb.set_def_depth(dict_depth);
1247
 
1248
  if (!load_kb.empty()){
1249
+ try { std::cerr << "Loading knowledge base: " << load_kb << "\n";
1250
+ load_kb_binary(kb, load_kb, dict_depth); std::cerr << "Loaded knowledge base: " << load_kb << "\n"; }
1251
+ catch (const std::exception &e){ std::cerr << "Error: " << e.what() << "\n"; }
1252
  }
1253
 
1254
  if (!learn_files.empty()){
 
1266
  std::cout << "\n";
1267
  if (!resp.empty()){for (size_t i=1;i<resp.size();++i) kb.add_pair(resp[i-1], resp[i]);}
1268
  if (!savefile.empty()){
1269
+ try { std::cerr << "Saving knowledge base: " << savefile << "\n";
1270
+ save_kb_binary(kb, savefile); std::cerr << "Saved knowledge base: " << savefile << "\n"; }
1271
+ catch (const std::exception &e){ std::cerr << "Error: " << e.what() << "\n"; }
1272
  }
1273
  }
1274