AI-Hypercomputer / AI-Hypercomputer/maxtext

Support beam search

Aberta
#594 0 comentários 0 reações 1 responsável Reivindicada por @vipannalla Ver no GitHub
feature request inference
Linguagem predominante
Python
Estrelas
2.4k
Forks
607
Merge médio
2d 19h
PRs com merge (30d)
158

Descrição

Hi,

It would be nice to support beam search.

There is [the reference flax implementation in wmt example](https://github.com/google/flax/blob/main/examples/wmt/decode.py) and [the equivalent one from `transformers`](https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py).

I am guessing that we could:
* duplicate inputs per num_beams initially
* at each step we do:
* decode_step
* select top beams
* overwrite entire past cache per selected beams
* update cache with new selected tokens

So maybe the extra step here is to add the "overwrite entire past cache per selected beams"?
Curious if you have suggestions for implementation

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.