Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/batched/batched.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "sampling.h"

#include <algorithm>
#include <clocale>
#include <cstdio>
#include <string>
#include <vector>
Expand All @@ -16,6 +17,8 @@ static void print_usage(int, char ** argv) {
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

common_params params;

params.prompt = "Hello my name is";
Expand Down
12 changes: 8 additions & 4 deletions examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
#include "common.h"
#include "log.h"

#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cassert>
#include <cinttypes>
#include <climits>
#include <cstring>
#include <clocale>
#include <cstdarg>
#include <cinttypes>
#include <cstring>
#include <ctime>
#include <unordered_map>
#include <vector>
#include <random>
#include <stdexcept>
#include <sstream>
Expand Down Expand Up @@ -874,6 +876,8 @@ static std::string basename(const std::string &path) {
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

common_init();

struct train_params params = get_default_train_params();
Expand Down
3 changes: 3 additions & 0 deletions examples/deprecation-warning/deprecation-warning.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// Warns users that this filename was deprecated, and provides a link for more information.

#include <clocale>
#include <cstdio>
#include <string>
#include <unordered_map>

// Main
int main(int argc, char** argv) {
std::setlocale(LC_NUMERIC, "C");

std::string filename = "main";
if (argc >= 1) {
filename = argv[0];
Expand Down
3 changes: 3 additions & 0 deletions examples/diffusion/diffusion-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <limits.h>

#include <algorithm>
#include <clocale>
#include <cmath>
#include <cstring>
#include <limits>
Expand Down Expand Up @@ -538,6 +539,8 @@ static std::string format_input_text(const std::string & prompt, const std::stri
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

ggml_time_init();

common_params params;
Expand Down
3 changes: 3 additions & 0 deletions examples/embedding/embedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "log.h"
#include "llama.h"

#include <clocale>
#include <ctime>
#include <algorithm>

Expand Down Expand Up @@ -94,6 +95,8 @@ static void print_raw_embeddings(const float * emb,
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

common_params params;

if (!common_params_parse(argc, argv, params, LLAMA_EXAMPLE_EMBEDDING)) {
Expand Down
4 changes: 4 additions & 0 deletions examples/eval-callback/eval-callback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "log.h"
#include "llama.h"
#include "llama-cpp.h"

#include <clocale>
#include <string>
#include <vector>

Expand All @@ -29,6 +31,8 @@ static bool run(llama_context * ctx, const common_params & params) {
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

base_callback_data cb_data;

common_params params;
Expand Down
3 changes: 3 additions & 0 deletions examples/gen-docs/gen-docs.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "arg.h"
#include "common.h"

#include <clocale>
#include <fstream>
#include <sstream>
#include <string>
Expand Down Expand Up @@ -100,6 +101,8 @@ static void write_help(std::ostringstream & ss, const md_file & md) {
}

int main(int, char **) {
std::setlocale(LC_NUMERIC, "C");

for (const auto & md : md_files) {
std::ifstream infile(md.fname);
if (!infile.is_open()) {
Expand Down
11 changes: 7 additions & 4 deletions examples/gguf-hash/gguf-hash.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#include "ggml.h"
#include "gguf.h"

#include <cstdlib> /* abort() */
#include <algorithm>
#include <clocale>
#include <cstddef>
#include <cstdio>
#include <string>
#include <stdexcept>
#include <algorithm>
#include <cstdlib> /* abort() */
#include <cstring>
#include <stdexcept>
#include <string>

#include <sstream>
#include <fstream>
Expand Down Expand Up @@ -626,6 +627,8 @@ static hash_exit_code_t gguf_hash(const hash_params & hash_params) {
}

int main(int argc, const char ** argv) {
std::setlocale(LC_NUMERIC, "C");

hash_params params;
manifest_check_params manifest_check;
hash_params_parse(argc, argv, params);
Expand Down
3 changes: 3 additions & 0 deletions examples/gguf/gguf.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "ggml.h"
#include "gguf.h"

#include <clocale>
#include <cstdio>
#include <string>
#include <sstream>
Expand Down Expand Up @@ -240,6 +241,8 @@ static bool gguf_ex_read_1(const std::string & fname, bool check_data) {
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

if (argc < 3) {
printf("usage: %s data.gguf r|w [n]\n", argv[0]);
printf("r: read data.gguf file\n");
Expand Down
5 changes: 4 additions & 1 deletion examples/lookahead/lookahead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
#include "log.h"
#include "llama.h"

#include <algorithm>
#include <clocale>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>

struct ngram_data {
bool active = false;
Expand Down Expand Up @@ -38,6 +39,8 @@ struct ngram_container {
};

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

common_params params;

if (!common_params_parse(argc, argv, params, LLAMA_EXAMPLE_COMMON)) {
Expand Down
3 changes: 3 additions & 0 deletions examples/lookup/lookup-create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
#include "ngram-cache.h"
#include "llama.h"

#include <clocale>
#include <string>
#include <vector>

int main(int argc, char ** argv){
std::setlocale(LC_NUMERIC, "C");

common_params params;

if (!common_params_parse(argc, argv, params, LLAMA_EXAMPLE_LOOKUP)) {
Expand Down
3 changes: 3 additions & 0 deletions examples/lookup/lookup-merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "common.h"
#include "ngram-cache.h"

#include <clocale>
#include <cstdint>
#include <cstdio>
#include <fstream>
Expand All @@ -17,6 +18,8 @@ static void print_usage(char* argv0) {
}

int main(int argc, char ** argv){
std::setlocale(LC_NUMERIC, "C");

if (argc < 3) {
print_usage(argv[0]);
exit(1);
Expand Down
5 changes: 4 additions & 1 deletion examples/lookup/lookup-stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
#include "llama.h"
#include "ggml.h"

#include <cinttypes>
#include <clocale>
#include <cstdint>
#include <cstdio>
#include <cinttypes>
#include <fstream>
#include <string>
#include <vector>

int main(int argc, char ** argv){
std::setlocale(LC_NUMERIC, "C");

common_params params;

if (!common_params_parse(argc, argv, params, LLAMA_EXAMPLE_LOOKUP)) {
Expand Down
3 changes: 3 additions & 0 deletions examples/lookup/lookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
#include "log.h"
#include "llama.h"

#include <clocale>
#include <cstdint>
#include <cstdio>
#include <fstream>
#include <string>
#include <vector>

int main(int argc, char ** argv){
std::setlocale(LC_NUMERIC, "C");

common_params params;

if (!common_params_parse(argc, argv, params, LLAMA_EXAMPLE_LOOKUP)) {
Expand Down
5 changes: 4 additions & 1 deletion examples/parallel/parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
#include "log.h"
#include "llama.h"

#include <algorithm>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <string>
#include <vector>
#include <ctime>
#include <algorithm>

// trim whitespace from the beginning and end of a string
static std::string trim(const std::string & str) {
Expand Down Expand Up @@ -153,6 +154,8 @@ static std::vector<std::string> split_string(const std::string& input, char deli
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

srand(1234);

common_params params;
Expand Down
3 changes: 3 additions & 0 deletions examples/passkey/passkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "log.h"
#include "llama.h"

#include <clocale>
#include <cmath>
#include <cstdio>
#include <string>
Expand All @@ -16,6 +17,8 @@ static void print_usage(int, char ** argv) {
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

common_params params;

params.n_junk = 250;
Expand Down
3 changes: 3 additions & 0 deletions examples/retrieval/retrieval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "llama.h"

#include <algorithm>
#include <clocale>
#include <fstream>
#include <iostream> // TODO: remove me

Expand Down Expand Up @@ -112,6 +113,8 @@ static void batch_process(llama_context * ctx, llama_batch & batch, float * outp
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

common_params params;

if (!common_params_parse(argc, argv, params, LLAMA_EXAMPLE_RETRIEVAL, print_usage)) {
Expand Down
3 changes: 3 additions & 0 deletions examples/save-load-state/save-load-state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
#include "common.h"
#include "llama.h"

#include <clocale>
#include <vector>
#include <cstdio>


int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

common_params params;

params.prompt = "The quick brown fox";
Expand Down
3 changes: 3 additions & 0 deletions examples/simple-chat/simple-chat.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "llama.h"
#include <clocale>
#include <cstdio>
#include <cstring>
#include <iostream>
Expand All @@ -12,6 +13,8 @@ static void print_usage(int, char ** argv) {
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

std::string model_path;
int ngl = 99;
int n_ctx = 2048;
Expand Down
3 changes: 3 additions & 0 deletions examples/simple/simple.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "llama.h"
#include <clocale>
#include <cstdio>
#include <cstring>
#include <string>
Expand All @@ -11,6 +12,8 @@ static void print_usage(int, char ** argv) {
}

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

// path to the model gguf file
std::string model_path;
// prompt to generate text from
Expand Down
3 changes: 3 additions & 0 deletions examples/speculative-simple/speculative-simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
#include "log.h"
#include "llama.h"

#include <clocale>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>

int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");

common_params params;

if (!common_params_parse(argc, argv, params, LLAMA_EXAMPLE_SPECULATIVE)) {
Expand Down
Loading
Loading