You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtorchfromparler_ttsimportParlerTTSForConditionalGenerationfromtransformersimportAutoTokenizerimportsoundfileassftorch_device="mps:0"torch_dtype=torch.bfloat16model_name="parler-tts/parler-tts-mini-v1"attn_implementation="eager"# "sdpa" or "flash_attention_2"model=ParlerTTSForConditionalGeneration.from_pretrained(
model_name,
attn_implementation=attn_implementation
).to(torch_device, dtype=torch_dtype)
tokenizer=AutoTokenizer.from_pretrained(model_name)
prompt="Hey, how are you doing today?"description="Jon's voice is monotone yet slightly fast in delivery, with a very close recording that almost has no background noise."input_ids=tokenizer(description, return_tensors="pt").input_ids.to(torch_device)
prompt_input_ids=tokenizer(prompt, return_tensors="pt").input_ids.to(torch_device)
generation=model.generate(input_ids=input_ids, prompt_input_ids=prompt_input_ids)
audio_arr=generation.cpu().numpy().squeeze()
sf.write("parler_tts_out.wav", audio_arr, model.config.sampling_rate)
I get this error:
ValueError: Can't infer missing attention mask on `mps` device. Please provide an `attention_mask` or use a different device.
Any idea what could be wrong?
Thanks!
The text was updated successfully, but these errors were encountered:
same problem for me.
I tried to use transformers version 4.44.2 (not supported by parler-tts) and it seems to use GPU but at the end saving the wav file, I get an error.
NotImplementedError: Output channels > 65536 not supported at the MPS device. As a temporary fix, you can set the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1 to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.
This is my simple test script:
I get this error:
ValueError: Can't infer missing attention mask on `mps` device. Please provide an `attention_mask` or use a different device.
Any idea what could be wrong?
Thanks!
The text was updated successfully, but these errors were encountered: