mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 01:24:36 +00:00
Merge remote-tracking branch 'occam/opencl-dev' into concedo_experimental
# Conflicts: # .github/workflows/build.yml # CMakeLists.txt # Makefile # README.md # ggml-opencl.cpp # llama.cpp # otherarch/ggml_v2-opencl-legacy.c
This commit is contained in:
commit
981d5ba866
14 changed files with 941 additions and 321 deletions
|
@ -76,7 +76,7 @@ std::string utils_gpt_random_prompt(std::mt19937 & rng) {
|
|||
return "The";
|
||||
}
|
||||
|
||||
void replace(std::string & str, const std::string & needle, const std::string & replacement) {
|
||||
void utreplace(std::string & str, const std::string & needle, const std::string & replacement) {
|
||||
size_t pos = 0;
|
||||
while ((pos = str.find(needle, pos)) != std::string::npos) {
|
||||
str.replace(pos, needle.length(), replacement);
|
||||
|
@ -148,9 +148,9 @@ std::map<std::string, int32_t> json_parse(const std::string & fname) {
|
|||
has_key = false;
|
||||
}
|
||||
|
||||
::replace(str_key, "\\u0120", " " ); // \u0120 -> space
|
||||
::replace(str_key, "\\u010a", "\n"); // \u010a -> new line
|
||||
::replace(str_key, "\\\"", "\""); // \\\" -> "
|
||||
::utreplace(str_key, "\\u0120", " " ); // \u0120 -> space
|
||||
::utreplace(str_key, "\\u010a", "\n"); // \u010a -> new line
|
||||
::utreplace(str_key, "\\\"", "\""); // \\\" -> "
|
||||
|
||||
try {
|
||||
result[str_key] = std::stoi(str_val);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue