# Using the .generate() function with a custom model class

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-the-generate-function-with-a-custom-model-class%2F32946%3E%5C
**Category:** Models\
**Created:** [March 3, 2023, 6:13am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-the-generate-function-with-a-custom-model-class%2F32946 "2023-03-03T06:13:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aneeshjain](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@aneeshjain](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Faneeshjain)%5C
**Post date:** [March 3, 2023, 6:13am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-the-generate-function-with-a-custom-model-class%2F32946%2F1 "2023-03-03T06:13:52Z")

</div>

Hi,

Im trying to use the .generate() function with a custom model class I have implemented. I want to use the generate function available within HuggingFace instead of implementing my own greedy/beam search functions. Is it possible to do this? I have been unable to find any documentation that describes how to do this.
