ggml : sync (ggml-alloc, GPU, eps, etc.) (#1220)

* ggml : sync (ggml-alloc, GPU, eps, etc.)

* ggml : fix build

* wasm : fix build
This commit is contained in:
Georgi Gerganov
2023-09-05 13:54:40 +03:00
committed by GitHub
parent 6780c98e19
commit 59a3d0cb57
17 changed files with 11254 additions and 4095 deletions

View File

@ -11,7 +11,7 @@
#define COMMON_SAMPLE_RATE 16000
//
// CLI argument parsing
// GPT CLI argument parsing
//
struct gpt_params {
@ -33,6 +33,8 @@ struct gpt_params {
bool interactive = false;
int32_t interactive_port = -1;
int32_t n_gpu_layers = 0;
};
bool gpt_params_parse(int argc, char ** argv, gpt_params & params);
@ -155,3 +157,20 @@ bool vad_simple(
// compute similarity between two strings using Levenshtein distance
float similarity(const std::string & s0, const std::string & s1);
//
// SAM argument parsing
//
struct sam_params {
int32_t seed = -1; // RNG seed
int32_t n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency());
std::string model = "models/sam-vit-b/ggml-model-f16.bin"; // model path
std::string fname_inp = "img.jpg";
std::string fname_out = "img.out";
};
bool sam_params_parse(int argc, char ** argv, sam_params & params);
void sam_print_usage(int argc, char ** argv, const sam_params & params);