Ahmadzei's picture
added 3 more tables for large emb model
5fa1a76
raw
history blame contribute delete
348 Bytes
Set the forced_bos_token_id to en in the generate method to translate to English:
generated_tokens = model.generate(**encoded_zh, forced_bos_token_id=tokenizer.get_lang_id("en"))
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
'Do not interfere with the matters of the witches, because they are delicate and will soon be angry.'