from transformers import WhisperForConditionalGeneration, WhisperProcessorimport torch, soundfile as sf, torchaudio.functional as AF proc = WhisperProcessor.from_pretrained("yehoshua01/waxal-whisper-turbo-lin-r2")model = WhisperForConditionalGeneration.from_pretrained("yehoshua01/waxal-whisper-turbo-lin-r2").eval().cuda()tok = proc.tokenizer# the language slot is a LEARNED decoder state -- use the token this checkpoint trained underforced = [(1, tok.convert_tokens_to_ids("<|sw|>")), (2, tok.convert_tokens_to_ids("<|transcribe|>")), (3, tok.convert_tokens_to_ids("<|notimestamps|>"))] wav, sr = sf.read("clip.wav", dtype="float32")wav = AF.resample(torch.from_numpy(wav), sr, 16_000).numpy()[:30 * 16_000]f = proc.feature_extractor(wav, sampling_rate=16_000, return_tensors="pt").input_featuresout = model.generate(f.to("cuda", model.dtype), forced_decoder_ids=forced, max_new_tokens=220)print(proc.batch_decode(out, skip_special_tokens=True)[0])