Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrOCR decoder_start_token should be eos instead of cls. #362

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 30, 2023

  1. Decoder start token should be eos instead of cls.

    When I pass `cls` or `bos` as the initial decoder token, the output (first decoded token) rarely get correct.
    But once I try to use `eos`, the output is correct, or at least similar with the output returned by `model.generate()`.
    
    In the official code from Microsoft, they will fallback to `eos` if the token is not specified https://github.com/microsoft/unilm/blob/6f60612e7cc86a2a1ae85c47231507a587ab4e01/trocr/generator.py#L84
    thariq-nugrohotomo committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    f2d8039 View commit details
    Browse the repository at this point in the history