# Using model() instead of model.generate()

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-model-instead-of-model-generate%2F116329%3E%5C
**Category:** 🤗Transformers\
**Created:** [November 8, 2024, 5:15am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-model-instead-of-model-generate%2F116329 "2024-11-08T05:15:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Vidushee](https://avatars.discourse-cdn.com/v4/letter/v/ecccb3/32.png) [@Vidushee](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FVidushee)%5C
**Post date:** [November 8, 2024, 6:03am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-model-instead-of-model-generate%2F116329%2F3 "2024-11-08T06:03:50Z")

</div>

Can you explain a bit more about your answer ? isn’t it just calling the forward pass ?  
And how about this ?

> [@Generate without using the generate method](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgenerate-without-using-the-generate-method%2F11379)%3A
>
> Posting this here for visibility. What if you want to decode the output of a generative seq2seq model (like T5, BART, etc.) yourself, without using the .generate() method? The code example below illustrates this. Suppose that the model is given a long text, for which it needs to generate a summary. We illustrate here how to manually decode the generated ids autoregressively. In each iteration, we add the predicted token id by the model to the decoder\_input\_ids, which are then fed as input to th…

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-model-instead-of-model-generate%2F116329)._
