]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
llama : add classifier-free guidance (#2135)
authorBach Le <redacted>
Tue, 11 Jul 2023 16:18:43 +0000 (00:18 +0800)
committerGitHub <redacted>
Tue, 11 Jul 2023 16:18:43 +0000 (19:18 +0300)
commitc9c74b4e3f9dcfab8b0032749ff8a579ab4e4d8d
tree651d6915218efa83cad8745310f7d1114ca21e2a
parent3ec7e596b2ba3f43c22f441254ca2bcfa91102ba
llama : add classifier-free guidance (#2135)

* Initial implementation

* Remove debug print

* Restore signature of llama_init_from_gpt_params

* Free guidance context

* Make freeing of guidance_ctx conditional

* Make Classifier-Free Guidance a sampling function

* Correct typo. CFG already means context-free grammar.

* Record sampling time in llama_sample_classifier_free_guidance

* Shift all values by the max value before applying logsoftmax

* Fix styling based on review
examples/common.cpp
examples/common.h
examples/main/main.cpp
llama.cpp
llama.h