    audio_data, sample_rate = torchaudio.load(audio_path)
    audio = audio_data.view(1, -1).float().to(device)
    bandwidth_id = torch.tensor([0])
    _, codes = quantizer.encode_infer(audio, bandwidth_id=bandwidth_id)
    raw_audio_tokens = codes + len(tokenizer) + 1024

    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(
