chore: bump version to 1.0.3

fix: force eager attention to resolve SDPA compatibility with output_attentions

Addresses issue #339 by forcing eager attention implementation in T3 transformer, preventing SDPA-related errors when output_attentions is enabled.
This commit is contained in:
james-song
2025-12-31 10:04:42 +09:00
parent 735e28ed82
commit ec2e9afdc5
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "comfyui-for-chatterbox"
version = "1.0.2"
version = "1.0.3"
description = "ComfyUI custom nodes for Chatterbox TTS with multilingual support (23 languages)"
readme = "README.md"
requires-python = ">=3.10"
+16
View File
@@ -63,6 +63,22 @@ class T3(nn.Module):
self.cfg = LlamaConfig(**config_dict)
self.tfmr = LlamaModel(self.cfg)
# Force eager attention to fix SDPA compatibility with output_attentions
# See: https://github.com/resemble-ai/chatterbox/issues/339
try:
if hasattr(self.tfmr, 'set_attn_implementation'):
self.tfmr.set_attn_implementation("eager")
if hasattr(self.tfmr.config, '_attn_implementation'):
self.tfmr.config._attn_implementation = "eager"
# Disable SDPA at PyTorch backend level
if hasattr(torch.backends, 'cuda') and hasattr(torch.backends.cuda, 'enable_flash_sdp'):
torch.backends.cuda.enable_flash_sdp(False)
torch.backends.cuda.enable_mem_efficient_sdp(False)
torch.backends.cuda.enable_math_sdp(True)
logger.info("Forced eager attention for T3 transformer")
except (AttributeError, Exception) as e:
logger.warning(f"Could not fully configure eager attention: {e}")
self.dim = self.cfg.hidden_size
self.deepspeed_patch_applied = False