-
treat stop as stop sequences, not exact tokens (#442)
发布于
2023-08-30 15:53:42 +00:00 The
stopoption to the generate API is a list of sequences that should cause generation to stop. Although these are commonly called "stop tokens", they do not necessarily correspond to LLM tokens (per the LLM's tokenizer). For example, if the caller sends a generate request with"stop":["\n"], then generation should stop on any token containing\n(and trim\nfrom the output), not just if the token exactly matches\n. Ifstopwere interpreted strictly as LLM tokens, then it would require callers of the generate API to know the LLM's tokenizer and enumerate many tokens in thestoplist.下载附件