Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

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

Open
zoubaihan opened this issue Jun 29, 2023 · 1 comment
Labels
question Further information is requested

Comments

@zoubaihan
Copy link

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?

@peakji peakji added the question Further information is requested label Jun 29, 2023
@peakji
Copy link
Member

peakji commented Jun 29, 2023

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...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants