Skip to content

Commit 3ba97a7

Browse files
coolkphx89
authored andcommitted
Signed-off-by: Kunjan patel <kunjanp@google.com>
1 parent ab45a33 commit 3ba97a7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/maxdiffusion/pipelines/wan/wan_pipeline.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@
3232
from maxdiffusion.video_processor import VideoProcessor
3333
from ...schedulers.scheduling_unipc_multistep_flax import FlaxUniPCMultistepScheduler, UniPCMultistepSchedulerState
3434
from transformers import AutoTokenizer, UMT5EncoderModel
35-
import ftfy
35+
from maxdiffusion.utils.import_utils import is_ftfy_available
3636
import html
3737
import re
3838
import torch
3939

4040

4141
def basic_clean(text):
42-
text = ftfy.fix_text(text)
42+
if is_ftfy_available():
43+
import ftfy
44+
text = ftfy.fix_text(text)
4345
text = html.unescape(html.unescape(text))
4446
return text.strip()
4547

0 commit comments

Comments
 (0)