meld main_.cpp llama_cpp_onicai_fork/examples/main/main.cpp
- use
main_instead ofmain - A few items related to console & ctrl+C need to be outcommented
- add
#include "ic_api.h" - replace
throw std::runtime_error(formatwithIC_API::trap(std::string("RUNTIME ERROR: ") + format - replace
throwwithIC_API::trap - outcomment
try - catch. The program will abrupt in case of thrown exceptions. - outcomment threading related items:
#include <future>#include <mutex>#include <thread>
- outcomment these functions completely:
llama_tensor_quantize_internalllama_model_quantize_internal
- add
#include "ic_api.h" - replace
throw std::runtime_error(formatwithIC_API::trap(std::string("RUNTIME ERROR: ") + format - outcomment
try - catch. The program will abrupt in case of thrown exceptions. - add a check on
llama_token_bos(model), else the llama2.c models never stop generating:bool llama_token_is_eog_impl(const struct llama_vocab & vocab, llama_token token) { return token != -1 && ( token == llama_token_eos_impl(vocab) || token == llama_token_eot_impl(vocab) || token == llama_token_bos_impl(vocab) // ICPP-PATCH: the llama2.c model predicts bos without first predicting an eos ); }
No changes needed
No changes needed
- no modifications needed for the IC
- add
#include "ic_api.h" - replace
throwwithIC_API::trap
- add
#include "ic_api.h" - replace
throwwithIC_API::trap - outcomment
try - catch. The program will abrupt in case of thrown exceptions.
- run this command to create it:
make build-info-cpp-wasm
- add
#include "ic_api.h" - replace
throwwithIC_API::trap - outcomment
try - catch. The program will abrupt in case of thrown exceptions.
- add
#include "ic_api.h" - replace
throwwithIC_API::trap
- add
#include "ic_api.h" - replace
throwwithIC_API::trap - outcomment all code related to
<pthread.h> - outcomment
try - catch. The program will abrupt in case of thrown exceptions. - outcomment
std::getenv
- outcomment all code related to signals
#include <signal.h>
- Many threading outcomments.
No updates needed for icpp-pro
No updates needed for icpp-pro
No updates needed for icpp-pro
No updates needed for icpp-pro
#include <thread>- Some other threading code
#include <thread>