ollama/server
Quinn Slack f4432e1dba
treat stop as stop sequences, not exact tokens (#442)
The `stop` option 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 `\n` from the output), not just if the token exactly matches `\n`. If `stop` were 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 the `stop` list.

Fixes https://github.com/jmorganca/ollama/issues/295.
2023-08-30 11:53:42 -04:00
..
auth.go loosen http status code checks 2023-08-28 18:34:53 -04:00
download.go loosen http status code checks 2023-08-28 18:34:53 -04:00
images.go treat stop as stop sequences, not exact tokens (#442) 2023-08-30 11:53:42 -04:00
modelpath.go use url.URL 2023-08-22 10:49:07 -07:00
modelpath_test.go fix FROM instruction erroring when referring to a file 2023-08-22 09:39:42 -07:00
routes.go add model IDs (#439) 2023-08-28 20:50:24 -07:00
upload.go remove unused parameter 2023-08-28 18:35:18 -04:00