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:
+1
-1
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user