# Feeding embeddings to \`model.generate\`

**URL:** <https://discuss.huggingface.co/t/feeding-embeddings-to-model-generate/27089>\
**Category:** Models\
**Created:** [December 1, 2022, 9:51pm UTC](https://discuss.huggingface.co/t/feeding-embeddings-to-model-generate/27089 "2022-12-01T21:51:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shantanuacharya](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/shantanuacharya/32/63659_2.png) [@shantanuacharya](https://discuss.huggingface.co/u/shantanuacharya)\
**Post date:** [December 1, 2022, 9:51pm UTC](https://discuss.huggingface.co/t/feeding-embeddings-to-model-generate/27089/1 "2022-12-01T21:51:35Z")

</div>

I am using GPT2 as the text generator for a video captioning model so instead of feeding GPT2 with token ids, I’m directly giving the video embeddings via `input_embeds` parameters.

Now during inference, to get the sentence predictions as output, I’m trying to use the `.generate()` function of GPT2 but I see that it only takes the token ids as inputs. Is there a way to give it the embeddings directly?
