model()與model.generate()的output相同嗎?
#3
by
cathat
- opened
我只是一個路人,但根據我遠古以前(2 年前)的經驗,我記得 model() 跟 model.generate() 在考慮的 context 會不同。這是 Huggingface API 的問題
簡言之前者是 greedy decoding (類似 teacher-forcing 的概念,也因而比較快) 但後者是 auto-regressive (考慮自己生成的 token ,因此可能會比較慢),而且還支援各種 sampling 方法
這邊應該可以參考: https://discuss.huggingface.co/t/what-is-the-difference-between-forward-and-generate/10235
No description provided.
cathat
changed discussion status to
closed
cathat
changed discussion status to
open
cathat
changed discussion status to
closed
cathat
changed discussion status to
open
謝謝您抽空回答我的問題,這幫了我很大的忙。
cathat
changed discussion status to
closed