Skip to content

Commit 43440c0

Browse files
committed
llama : add llama_sampling and combine it with llama_grammar
ggml-ci
1 parent e31a4f6 commit 43440c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1612
-1554
lines changed

Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,6 @@ OBJ_COMMON = \
921921
common/ngram-cache.o \
922922
common/sampling.o \
923923
common/train.o \
924-
common/grammar-parser.o \
925924
common/build-info.o \
926925
common/json-schema-to-grammar.o
927926

@@ -1161,11 +1160,6 @@ common/console.o: \
11611160
common/console.h
11621161
$(CXX) $(CXXFLAGS) -c $< -o $@
11631162

1164-
common/grammar-parser.o: \
1165-
common/grammar-parser.cpp \
1166-
common/grammar-parser.h
1167-
$(CXX) $(CXXFLAGS) -c $< -o $@
1168-
11691163
common/json-schema-to-grammar.o: \
11701164
common/json-schema-to-grammar.cpp \
11711165
common/json-schema-to-grammar.h

common/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ add_library(${TARGET} STATIC
5858
sampling.cpp
5959
console.h
6060
console.cpp
61-
grammar-parser.h
62-
grammar-parser.cpp
6361
json.hpp
6462
json-schema-to-grammar.cpp
6563
train.h

common/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,7 @@ std::tuple<struct llama_model *, struct llama_context *> llama_init_from_gpt_par
21322132
llama_decode(lctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch), 0, 0));
21332133
llama_kv_cache_clear(lctx);
21342134
llama_synchronize(lctx);
2135-
llama_reset_timings(lctx);
2135+
llama_reset_timings(lctx, nullptr);
21362136
}
21372137

21382138
return std::make_tuple(model, lctx);

0 commit comments

Comments
 (0)