Skip to content

Commit e5e7063

Browse files
authored
Remove single quote pattern to avoid wrong matches (#9842)
1 parent 29bf807 commit e5e7063

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

comfy/text_encoders/hunyuan_image.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@ def tokenize_with_weights(self, text:str, return_word_ids=False, **kwargs):
2222

2323
# ByT5 processing for HunyuanImage
2424
text_prompt_texts = []
25-
pattern_quote_single = r'\'(.*?)\''
2625
pattern_quote_double = r'\"(.*?)\"'
2726
pattern_quote_chinese_single = r'‘(.*?)’'
2827
pattern_quote_chinese_double = r'“(.*?)”'
2928

30-
matches_quote_single = re.findall(pattern_quote_single, text)
3129
matches_quote_double = re.findall(pattern_quote_double, text)
3230
matches_quote_chinese_single = re.findall(pattern_quote_chinese_single, text)
3331
matches_quote_chinese_double = re.findall(pattern_quote_chinese_double, text)
3432

35-
text_prompt_texts.extend(matches_quote_single)
3633
text_prompt_texts.extend(matches_quote_double)
3734
text_prompt_texts.extend(matches_quote_chinese_single)
3835
text_prompt_texts.extend(matches_quote_chinese_double)

0 commit comments

Comments
 (0)