transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Provide clearer instructions on how to specify target language.

Open khof312 opened this issue 8 months ago • 1 comments

In the current documentation, I believe there is an error in the sample code. While the language token of the input is specified as <2pt> (Portuguese), the returned translation is in Italian, so actually the language should be <2it>.

I didn't initially understand that this was a token for the target language, so I have added an explanation of this to the documentation as well as instructions on how to get the available languages based on the code in Juarez Bochi's demo space.

It would be good to check that I have retrieved the correct range of tokens (4-459) and not omitted any (there were some additional tokens that looked to refer to scripts instead of languages, but I was not sure).

If these changes are approved, then they should also be perpetuated to the documentation of the different model checkpoints from google and jbochi.

khof312 avatar Jun 12 '25 10:06 khof312

Hi @khof312, "Eu amo pizza!" is Portuguese, not Italian. The reference to pizza is deceptive, I realize, but in Italian this would be "Amo la pizza!", or maybe "Io amo la pizza!".

Rocketknight1 avatar Jun 12 '25 14:06 Rocketknight1

Oops, you are right about the language, my mistake. In this case the <2pt> language code (line 56) need not be changed, but is it still worth adding documentation of how to find the respective language codes?

(I have changed the associated file accordingly to fix my error).

khof312 avatar Jul 18 '25 14:07 khof312

cc @stevhliu for the docs question!

Rocketknight1 avatar Jul 21 '25 12:07 Rocketknight1