llama.cpp/common
Justine Tunney 436787f170
llama : fix time complexity of string replacement (#9163)
This change fixes a bug where replacing text in a very long string could
cause llama.cpp to hang indefinitely. This is because the algorithm used
was quadratic, due to memmove() when s.replace() is called in a loop. It
seems most search results and LLM responses actually provide the O(n**2)
algorithm, which is a great tragedy. Using a builder string fixes things
2024-08-26 09:09:53 +03:00
..
cmake
base64.hpp
build-info.cpp.in
CMakeLists.txt
common.cpp llama : fix time complexity of string replacement (#9163) 2024-08-26 09:09:53 +03:00
common.h server : support reading arguments from environment variables (#9105) 2024-08-21 11:04:34 +02:00
console.cpp
console.h
grammar-parser.cpp grammar-parser : fix possible null-deref (#9004) 2024-08-12 15:36:41 +03:00
grammar-parser.h
json-schema-to-grammar.cpp
json-schema-to-grammar.h
json.hpp
log.h
ngram-cache.cpp
ngram-cache.h
sampling.cpp
sampling.h
stb_image.h
train.cpp
train.h