How to constraint decode using a prompt in Huggingface (encoder-decoder model)?

246 Views Asked by At

I am trying to use Huggingface generate() function for sequence generation task. My model uses encoder-decoder architecture, where I can't really do prompting. But what I can do is forcing the model to start generating tokens right after the prompt. The output should contain the completed-text. Basically, I want to provide a context & a prompt to a decoder. Anyone knows how can I achieve this ?

0

There are 0 best solutions below