diff --git a/scripts/modelscope/clip_hardcode.py b/scripts/modelscope/clip_hardcode.py index f204e3d..d445a53 100644 --- a/scripts/modelscope/clip_hardcode.py +++ b/scripts/modelscope/clip_hardcode.py @@ -150,7 +150,7 @@ def tokenize_line(self, line): Returns the list and the total number of tokens in the prompt. """ - if opts.enable_emphasis: + if hasattr(opts, 'enable_emphasis') and opts.enable_emphasis: parsed = prompt_parser.parse_prompt_attention(line) else: parsed = [[line, 1.0]]