llama.cpp/examples
Evan Jones 84e09a7d8b
llama : add grammar-based sampling (#1773)
* llama, main : constrain sampling to grammar

* allow loading grammar from file

* fix whitespace errors

* handle & print parser errors

* add comments to grammar syntax and allow newlines where unambiguous

* add missing include

* support alternates in root rule

* fix bugs with empty token and EOS

* adjust JSON grammar

* remove swp file

* rewrite ternary expressions

Co-authored-by: Henri Vasserman <henv@hot.ee>

* use struct for grammar elements and add Unicode support

* add unicode escapes

* add inverse char ranges

* only sample full tokens (no peeking or truncation)

* llama : minor style changes

blindly applied in online editor - hopefully I didn't break something

* update help text

* add warning message if EOS is disabled

---------

Co-authored-by: Henri Vasserman <henv@hot.ee>
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
2023-07-23 23:58:10 -04:00
..
baby-llama cmake : install targets (#2256) 2023-07-19 10:01:11 +03:00
benchmark cmake : install targets (#2256) 2023-07-19 10:01:11 +03:00
embd-input examples : fix typo in minigpt4.py (#2298) 2023-07-21 14:53:07 +03:00
embedding cmake : install targets (#2256) 2023-07-19 10:01:11 +03:00
jeopardy hooks : setting up flake8 and pre-commit hooks (#1681) 2023-06-17 13:32:48 +03:00
main llama : add grammar-based sampling (#1773) 2023-07-23 23:58:10 -04:00
metal cmake : install targets (#2256) 2023-07-19 10:01:11 +03:00
perplexity Perplexity: Compute scores correlated to HellaSwag (#2312) 2023-07-22 14:21:24 +02:00
quantize cmake : install targets (#2256) 2023-07-19 10:01:11 +03:00
quantize-stats cmake : install targets (#2256) 2023-07-19 10:01:11 +03:00
save-load-state cmake : install targets (#2256) 2023-07-19 10:01:11 +03:00
server Add gqa parameter support to the server (#2351) 2023-07-23 23:31:17 +03:00
simple cmake : install targets (#2256) 2023-07-19 10:01:11 +03:00
train-text-from-scratch ggml : fix rope args order + assert (#2054) 2023-07-21 14:51:34 +03:00
alpaca.sh alpaca.sh : update model file name (#2074) 2023-07-06 19:17:50 +03:00
chat-13B.bat Create chat-13B.bat (#592) 2023-03-29 20:21:09 +03:00
chat-13B.sh examples : read chat prompts from a template file (#1196) 2023-05-03 20:58:11 +03:00
chat-persistent.sh chat-persistent.sh : use bracket expressions in grep (#1564) 2023-05-24 09:16:22 +03:00
chat-vicuna.sh examples : add chat-vicuna.sh (#1854) 2023-06-15 21:05:53 +03:00
chat.sh If n_predict == -1, generate forever 2023-03-25 21:51:41 +02:00
CMakeLists.txt llama : add grammar-based sampling (#1773) 2023-07-23 23:58:10 -04:00
common.cpp llama : add grammar-based sampling (#1773) 2023-07-23 23:58:10 -04:00
common.h llama : add grammar-based sampling (#1773) 2023-07-23 23:58:10 -04:00
gpt4all.sh examples : add -n to alpaca and gpt4all scripts (#706) 2023-04-13 16:03:39 +03:00
grammar-parser.cpp llama : add grammar-based sampling (#1773) 2023-07-23 23:58:10 -04:00
grammar-parser.h llama : add grammar-based sampling (#1773) 2023-07-23 23:58:10 -04:00
llama2-13b.sh gitignore : changes for Poetry users + chat examples (#2284) 2023-07-21 13:53:27 +03:00
llama2.sh gitignore : changes for Poetry users + chat examples (#2284) 2023-07-21 13:53:27 +03:00
llm.vim examples : simplify vim plugin (#2327) 2023-07-23 14:16:48 +03:00
make-ggml.py examples : add easy python script to create quantized (k-bit support) GGML models from local HF Transformer models (#2311) 2023-07-21 22:01:10 +03:00
Miku.sh MIKU MAYHEM: Upgrading the Default Model for Maximum Fun 🎉 (#2287) 2023-07-21 11:13:18 +03:00
reason-act.sh add example of re-act pattern (#583) 2023-03-29 10:10:24 -05:00