[Bug] cannot import name 'LogitsWarper' from 'transformers', from transformers import LogitsWarper
Describe the bug
Hi
what i run finetune code for tts v2
i get this error
from TTS.tts.layers.xtts.trainer.gpt_trainer import GPTArgs, GPTTrainer, GPTTrainerConfig, XttsAudioConfig
File "/home/user/workspace/dataset/TTS/venv/lib/python3.11/site-packages/TTS/tts/layers/xtts/trainer/gpt_trainer.py", line 15, in
To Reproduce
run https://github.com/coqui-ai/TTS/blob/dev/recipes/ljspeech/xtts_v2/train_gpt_xtts.py script
Expected behavior
No response
Logs
Environment
TTS==0.22.0
torch==2.6.0
torchaudio==2.6.0
transformers==4.49.0
Additional context
No response
This repo is not maintained anymore and doesn't work with latest versions of Pytorch and transformers. You can use our fork instead, available via pip install coqui-tts
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.
I found a solution. I replaced the "LogitsWarper" with "LogitsProcessor". The error ocurred for me when I was trying to use tortoise.
In my example the affected file was env/site-packages/TTS/tts/layers/tortoise/arch_utils.py
line 10:
from transformers import LogitsWarper -> from transformers import LogitsProcessor
line 401:
class TypicalLogitsWarper(LogitsWarper): -> class TypicalLogitsWarper(LogitsProcessor):
hi, I got same error, I'll try your approach. Thanks
@fisand08 @bmt621 As mentioned above you can just use the fork with pip install coqui-tts where this and many other issues are fixed. This repo here is no longer updated.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.
go to the eginhard fork, he solved a lot of issues.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.
I found a solution. I replaced the "LogitsWarper" with "LogitsProcessor". The error ocurred for me when I was trying to use tortoise.
In my example the affected file was env/site-packages/TTS/tts/layers/tortoise/arch_utils.py
line 10:
from transformers import LogitsWarper->from transformers import LogitsProcessorline 401:class TypicalLogitsWarper(LogitsWarper):->class TypicalLogitsWarper(LogitsProcessor):
It works, thank you @fisand08!