Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor for compatibility with transformers>=4.47 #319

Merged
merged 3 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions TTS/tts/layers/tortoise/arch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import torch.nn as nn
import torch.nn.functional as F
import torchaudio
from transformers import LogitsWarper
from transformers import LogitsProcessor

from TTS.tts.layers.tortoise.xtransformers import ContinuousTransformerWrapper, RelativePositionBias
from TTS.utils.generic_utils import is_pytorch_at_least_2_4
Expand Down Expand Up @@ -292,7 +292,7 @@ def forward(self, x, **kwargs):
return h


class TypicalLogitsWarper(LogitsWarper):
class TypicalLogitsWarper(LogitsProcessor):
def __init__(
self,
mass: float = 0.9,
Expand Down
4 changes: 2 additions & 2 deletions TTS/tts/layers/xtts/stream_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ def generate( # noqa: PLR0911
)
model_kwargs["attention_mask"] = self._prepare_attention_mask_for_generation(
inputs_tensor,
generation_config._pad_token_tensor,
generation_config._eos_token_tensor,
generation_config,
model_kwargs,
)

# decoder-only models should use left-padding for generation
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ dependencies = [
"gruut[de,es,fr]>=2.4.0",
# Tortoise
"einops>=0.6.0",
"transformers>=4.43.0,<=4.46.2",
"transformers>=4.47.0",
# Bark
"encodec>=0.1.1",
# XTTS
Expand Down
Loading