summaryrefslogtreecommitdiff
path: root/examples/embd-input/embd-input-test.cpp
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-10-20 21:07:23 +0300
committerGitHub <noreply@github.com>2023-10-20 21:07:23 +0300
commitd1031cf49c3b958b915fd558e23453471c29ac33 (patch)
tree14fa2bc6d54d5e27bd1e8bfd6fa4dbf894dbe6b9 /examples/embd-input/embd-input-test.cpp
parent8cf19d60dc93809db8e51fedc811595eed9134c5 (diff)
sampling : refactor init to use llama_sampling_params (#3696)
* sampling : refactor init to use llama_sampling_params * llama : combine repetition, frequency and presence penalties in 1 call * examples : remove embd-input and gptneox-wip * sampling : rename penalty params + reduce size of "prev" vector * sampling : add llama_sampling_print helper * sampling : hide prev behind API and apply #3661 ggml-ci
Diffstat (limited to 'examples/embd-input/embd-input-test.cpp')
-rw-r--r--examples/embd-input/embd-input-test.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/examples/embd-input/embd-input-test.cpp b/examples/embd-input/embd-input-test.cpp
deleted file mode 100644
index dc4a0e48..00000000
--- a/examples/embd-input/embd-input-test.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "embd-input.h"
-#include <stdlib.h>
-#include <random>
-#include <string.h>
-
-int main(int argc, char** argv) {
-
- auto mymodel = create_mymodel(argc, argv);
- int N = 10;
- int max_tgt_len = 500;
- int n_embd = llama_n_embd(llama_get_model(mymodel->ctx));
-
- // add random float embd to test evaluation
- float * data = new float[N*n_embd];
- std::default_random_engine e;
- std::uniform_real_distribution<float> u(0,1);
- for (int i=0;i<N*n_embd;i++) {
- data[i] = u(e);
- }
-
- eval_string(mymodel, "user: what is the color of the flag of UN?");
- eval_float(mymodel, data, N);
- eval_string(mymodel, "assistant:");
- eval_string(mymodel, mymodel->params.prompt.c_str());
- const char* tmp;
- for (int i=0; i<max_tgt_len; i++) {
- tmp = sampling(mymodel);
- if (strcmp(tmp, "</s>")==0) break;
- printf("%s", tmp);
- fflush(stdout);
- }
- printf("\n");
- free_mymodel(mymodel);
- return 0;
-}