diff --git a/Makefile b/Makefile index ef823db25..7dbca3a85 100644 --- a/Makefile +++ b/Makefile @@ -912,7 +912,7 @@ gbnf-validator: examples/gbnf-validator/gbnf-validator.cpp ggml.o llama.o $(COMM $(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<) $(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS) -llamacheck: examples/llamacheck/llamacheck.cpp ggml.o llama.o $(COMMON_DEPS) $(OBJS) +llamacheck: examples/llamacheck/llamacheck.cpp ggml.o llama.o $(COMMON_DEPS) $(OBJS) $(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<) $(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS) diff --git a/examples/llamacheck/llamacheck.cpp b/examples/llamacheck/llamacheck.cpp index 4c54192d0..ec7c0cae3 100644 --- a/examples/llamacheck/llamacheck.cpp +++ b/examples/llamacheck/llamacheck.cpp @@ -1,7 +1,4 @@ #include "common.h" -#include "llama.h" - -#include #include #include #include @@ -66,6 +63,7 @@ int main(int argc, char ** argv) { std::string prompt_template = "You will see two sentences. The first is marked INCORRECT and has a plethora of spelling and grammatical issues, the second is marked CORRECT and shows the fixed version of the prior sentence. INCORRECT:"; std::string prompt_suffix = " CORRECT: "; std::string input_string = ""; + LOG_TEE(">>>\n"); while (std::getline(std::cin, input_string, '\n')) { if (input_string == "q") { break; @@ -144,7 +142,7 @@ int main(int argc, char ** argv) { const llama_token new_token_id = llama_sample_token_greedy(ctx, &candidates_p); // is it an end of generation? - if (llama_token_is_eog(model, new_token_id) || n_cur == n_len) { + if (llama_token_is_eog(model, new_token_id) || n_cur >= n_len) { LOG_TEE("\n"); break; @@ -182,6 +180,7 @@ int main(int argc, char ** argv) { fprintf(stderr, "\n"); llama_batch_free(batch); + LOG_TEE(">>>\n"); } diff --git a/llamacheck b/llamacheck new file mode 100755 index 000000000..2f9659da6 Binary files /dev/null and b/llamacheck differ