abetlen / abetlen/llama-cpp-python

Support for a limited vocabulary for generation

Đang mở
#998 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
question
Ngôn ngữ chính
Python
Star
10.6k
Fork
1.4k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

**Is your feature request related to a problem? Please describe.**
I would like to constrain the model output to only use a custom vocabulary comprising a list of allowable words (or alternatively, to blacklist all other words in the vocabulary).

**Describe the solution you'd like**
HuggingFace's transformer library features a `bad_words_id` keyword in the `model.generate` function that accepts a list of words to exclude from its output (some discussion of this feature [here](https://github.com/huggingface/transformers/issues/21961)).

**Describe alternatives you've considered**
Could this possibly be achieved with the use of a `llama_cpp.LogitsProcessor`? I am less familiar with this library and haven't found examples in a similar direction, so am unsure how straightforward this could be to implement using one of those.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.