Switch on new implementation by default

This commit is contained in:
asagi4
2025-06-08 00:55:40 +03:00
parent 74f65c1b31
commit f4e57ec514
2 changed files with 13 additions and 5 deletions
+12 -4
View File
@@ -547,12 +547,20 @@ def advanced_encode_from_tokens(
tokenizer=None,
**extra_args,
):
if "new+" in weight_interpretation:
weight_interpretation = weight_interpretation.replace("new+", "")
if "old+" not in weight_interpretation:
enc = AdvancedEncoder(
encode_func, weight_interpretation, token_normalization, tokenizer, m_token, w_max, **extra_args
)
log.info("Using new implementation for %s", weight_interpretation)
return enc(tokenized, return_pooled=return_pooled, apply_to_pooled=apply_to_pooled)
else:
return old_advanced_encode_from_tokens(tokenized, token_normalization, weight_interpretation, encode_func, 266, return_pooled=return_pooled, apply_to_pooled=apply_to_pooled)
weight_interpretation = weight_interpretation.replace("old+", "")
log.warning("Using old implementation of %s", weight_interpretation)
return old_advanced_encode_from_tokens(
tokenized,
token_normalization,
weight_interpretation,
encode_func,
266,
return_pooled=return_pooled,
apply_to_pooled=apply_to_pooled,
)
+1 -1
View File
@@ -65,7 +65,7 @@ def get_style(text, default_style="comfy", default_normalization="none"):
style, normalization = styles[0]
style = style.strip()
normalization = normalization.strip()
if style.replace("new+", "") not in AVAILABLE_STYLES:
if style.replace("old+", "") not in AVAILABLE_STYLES:
log.warning("Unrecognized prompt style: %s. Using %s", style, default_style)
for part in normalization.split("+"):