From 7d60ce9275f79464e4945df6387d904cf903b276 Mon Sep 17 00:00:00 2001 From: Kunjan patel Date: Mon, 23 Jun 2025 18:09:23 +0000 Subject: [PATCH] ftfy check Signed-off-by: Kunjan patel --- src/maxdiffusion/pipelines/wan/wan_pipeline.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/maxdiffusion/pipelines/wan/wan_pipeline.py b/src/maxdiffusion/pipelines/wan/wan_pipeline.py index 0e8336c81..a3be8e138 100644 --- a/src/maxdiffusion/pipelines/wan/wan_pipeline.py +++ b/src/maxdiffusion/pipelines/wan/wan_pipeline.py @@ -32,14 +32,16 @@ from maxdiffusion.video_processor import VideoProcessor from ...schedulers.scheduling_unipc_multistep_flax import FlaxUniPCMultistepScheduler, UniPCMultistepSchedulerState from transformers import AutoTokenizer, UMT5EncoderModel -import ftfy +from maxdiffusion.utils.import_utils import is_ftfy_available import html import re import torch def basic_clean(text): - text = ftfy.fix_text(text) + if is_ftfy_available(): + import ftfy + text = ftfy.fix_text(text) text = html.unescape(html.unescape(text)) return text.strip()