minor fixes

This commit is contained in:
Minsoo Cheong 2024-03-22 01:35:09 +09:00
parent 50f9967043
commit 751787e6f7
2 changed files with 3 additions and 6 deletions

View file

@ -1323,7 +1323,7 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
printf(" files containing context to embed.\n");
printf(" --chunk-size N minimum length of embedded text chunk (default:%d)\n", params.chunk_size);
printf(" --chunk-separator STRING\n");
printf(" string to separate chunks (default: newline)\n");
printf(" string to separate chunks (default: \"\\n\")\n");
printf(" -n N, --n-predict N number of tokens to predict (default: %d, -1 = infinity, -2 = until context filled)\n", params.n_predict);
printf(" -c N, --ctx-size N size of the prompt context (default: %d, 0 = loaded from model)\n", params.n_ctx);
printf(" -b N, --batch-size N logical maximum batch size (default: %d)\n", params.n_batch);

View file

@ -8,11 +8,11 @@ struct chunk {
// filename
std::string filename;
// original file position
int64_t filepos;
size_t filepos;
// original text data
std::string textdata = "";
// tokenized text data
std::vector<std::int32_t> tokens;
std::vector<llama_token> tokens;
// embedding
std::vector<float> embedding;
// cosin similarity
@ -240,9 +240,6 @@ int main(int argc, char ** argv) {
while (true) {
printf("Enter query: ");
std::getline(std::cin, query);
if (query == "exit" || query == "quit" || query == "q") {
break;
}
std::vector<int32_t> query_tokens = llama_tokenize(ctx, query, true);
struct llama_batch query_batch = llama_batch_init(n_batch, 0, 1);