basaran icon indicating copy to clipboard operation
basaran copied to clipboard

I want use the function prefix_allowed_tokens_fn, where of basaran's source code shall I modify?

Open zoubaihan opened this issue 2 years ago • 1 comments

Hello, we all know that in huggingface transformers' origin model.generate() method, we can set the function paremeterprefix_allowed_tokens_fn to restrict the generate rule. I want to use this function in basaran just like I used in origin model.generate(), could you please tell me where of the source code shall I modify to make the model generation obey my custom prefix_allowed_tokens_fn?

zoubaihan avatar Jun 29 '23 08:06 zoubaihan

Generation related features can be implemented by modifying StreamModel.generate().

However, the original implementation from HF Transformers may require significant modifications to support streaming. This is also the main obstacle that prevents us from achieving feature parity...

peakji avatar Jun 29 '23 14:06 peakji