Error in getting text

#14
by Atharva-solanki - opened
This comment has been hidden
Atharva-solanki changed discussion title from API to Error in getting text

TypeError: argument 'ids': 'list' object cannot be interpreted as an integer

Hey @Atharva-solanki , do you have a script to reproduce the issue?

Same issue.

Hey @Longbo , same question, do you have a script to reproduce the issue?

it was an error from my side only
below is the correct code
translated_text_from_text = processor.decode(output_tokens[0].tolist()[0], skip_special_tokens=True)

Thanks @Atharva-solanki ! Did this code resolve your issue @Longbo ?

No, this code is not work.

Can u share your complete code?

where to find the spkr_id for target lang

use any no. between 1-10 fro spkr id , i.e spkr_id =1

        text_inputs = processor(text = prompt, src_lang=src_lang, return_tensors="pt")
        output_tokens = model.generate(**text_inputs, tgt_lang=tgt_lang, generate_speech=False)
        translated_text_from_text = processor.decode(output_tokens[0].tolist(), skip_special_tokens=True)

argument 'ids': 'list' object cannot be interpreted as an integer

Issue: Incorrect example in the model page. output_tokens[0].tolist() should be output_tokens[0].tolist()[0] in translated_text_from_text.

Solution: fix example!

Sign up or log in to comment