# What does model.generate do I'm not?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhat-does-model-generate-do-im-not%2F85476%3E%5C
**Category:** Beginners\
**Created:** [May 6, 2024, 6:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhat-does-model-generate-do-im-not%2F85476 "2024-05-06T18:09:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![chaaaaaaaa](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@chaaaaaaaa](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fchaaaaaaaa)%5C
**Post date:** [July 29, 2024, 4:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhat-does-model-generate-do-im-not%2F85476%2F3 "2024-07-29T16:45:33Z")

</div>

I never solved this, but it is most likely a combination of the following:

1. Not using the advanced decoding methods inference does (top-k,top-p,beam-search)
2. The format does not match the original training data.
3. Hugging face quirks

While I still feel the outputs should at least be in the same ballpark, it’s understandable that the training output is poor.

My suggestion is to use hugging face sparingly. It’s easy to use, but that means it is opaque to what’s going on. I’ve spent a lot of time trying to figure out what the hugging face code is doing when I get unusual results. Unless you are doing “standard” work, it’s best to avoid it. It takes more time, but building the system from lower-level code normally pays off. It may be more complex, but it’s easier to debug and understand.

You can see another issue I have that shows the potential weirdness when using hugging face methods.

> [@What does hugging face trainer do special?](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhat-does-hugging-face-trainer-do-special%2F97031)%3A
>
> I am trying to build my training loop and find that the hugging face trainer is significantly better at learning from a single example than my method. Why? I am using a training loop that is as similar as possible. I am unaware of what a hugging face does in the background, but it seems pretty significantly different. It also seems to take a lot longer than my training. Is it possible that the hugging face trainer is training more than it says it is? I chose the question answer specifically …

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhat-does-model-generate-do-im-not%2F85476)._
