abetlen / abetlen/llama-cpp-python

Dynamically intterupt token generation

オープン
#599 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
10.6k
フォーク
1.4k
PR マージ指標
PR 指標を取得中

説明

**Is your feature request related to a problem? Please describe.**
During the generation of tokens I would like to stop when I encounter some condition that changes during the runtime, using `Stream=True`.
E.g. I would like to stop generation after 5 lines of generation.

**Describe the solution you'd like**
I would like a method on llm called `stop()`, or `interrupt()`, that forces the model to stop after the next token is generated, similar to CTRL+C in the regular llama.cpp

**Describe alternatives you've considered**
I have considered adding a newline as stop token, but I think this is not performant. Another way I can think of is changing the `stop` list after passing it the generation method, but that feels hacky.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。