KevinNg99 commited on
Commit
2146e50
Β·
1 Parent(s): 3dac27a

update text encoding process

Browse files
hyimage/diffusion/pipelines/hunyuanimage_pipeline.py CHANGED
@@ -340,17 +340,14 @@ class HunyuanImagePipeline:
340
 
341
  try:
342
  text_prompt_texts = []
343
- pattern_quote_single = r'\'(.*?)\''
344
  pattern_quote_double = r'\"(.*?)\"'
345
  pattern_quote_chinese_single = r'β€˜(.*?)’'
346
  pattern_quote_chinese_double = r'β€œ(.*?)”'
347
 
348
- matches_quote_single = re.findall(pattern_quote_single, prompt)
349
  matches_quote_double = re.findall(pattern_quote_double, prompt)
350
  matches_quote_chinese_single = re.findall(pattern_quote_chinese_single, prompt)
351
  matches_quote_chinese_double = re.findall(pattern_quote_chinese_double, prompt)
352
 
353
- text_prompt_texts.extend(matches_quote_single)
354
  text_prompt_texts.extend(matches_quote_double)
355
  text_prompt_texts.extend(matches_quote_chinese_single)
356
  text_prompt_texts.extend(matches_quote_chinese_double)
 
340
 
341
  try:
342
  text_prompt_texts = []
 
343
  pattern_quote_double = r'\"(.*?)\"'
344
  pattern_quote_chinese_single = r'β€˜(.*?)’'
345
  pattern_quote_chinese_double = r'β€œ(.*?)”'
346
 
 
347
  matches_quote_double = re.findall(pattern_quote_double, prompt)
348
  matches_quote_chinese_single = re.findall(pattern_quote_chinese_single, prompt)
349
  matches_quote_chinese_double = re.findall(pattern_quote_chinese_double, prompt)
350
 
 
351
  text_prompt_texts.extend(matches_quote_double)
352
  text_prompt_texts.extend(matches_quote_chinese_single)
353
  text_prompt_texts.extend(matches_quote_chinese_double)