transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Typo in Greedy Search Description

Open awinml opened this issue 2 years ago • 2 comments

System Info

  • transformers version: 4.28.0.dev0
  • Platform: Linux-5.15.0-58-generic-x86_64-with-glibc2.29
  • Python version: 3.8.10
  • Huggingface_hub version: 0.11.1
  • PyTorch version (GPU?): 1.13.1+cu117 (False)
  • Tensorflow version (GPU?): 2.11.0 (False)
  • Flax version (CPU?/GPU?/TPU?): 0.5.0 (cpu)
  • Jax version: 0.3.6
  • JaxLib version: 0.3.5
  • Using GPU in script?: False
  • Using distributed or parallel set-up in script?: False

Who can help?

@sgugger

Reproduction

There is a small typographical error in the documentation for Greedy Search.

https://github.com/huggingface/transformers/blob/ff20f9cf3615a8638023bc82925573cb9d0f3560/docs/source/en/generation_strategies.mdx?plain=1#L149-L152

Proposed Solution

This could be fixed by just rewriting this to:

[`generate`] uses greedy search decoding by default so you don't have to pass any parameters to enable it. This means the parameters `num_beams` is set to 1 and `do_sample=False`.

awinml avatar Mar 23 '23 11:03 awinml

Sure, would you like to suggest a PR?

sgugger avatar Mar 23 '23 12:03 sgugger

Yeah, I can open a PR to fix this.

awinml avatar Mar 23 '23 14:03 awinml