    eoa = tokenizer(end_audio_token, return_tensors="pt")["input_ids"][:, -1:].to(device)
    audio_tokens = torch.cat([soa, raw_audio_tokens.view(1, -1), eoa], dim=1)
    tokens = torch.cat([audio_tokens], dim=1)
    attention_mask = torch.ones(tokens.size(), device=device)
    output_text_tokens = model.generate(

        attention_mask=attention_mask,
        max_new_tokens=max_seq_length,
        do_sample=False,
        num_beams=5, no_repeat_ngram_size=4,
        length_penalty=2.0,
