Skip to content

Commit

Permalink
Fix checking possibly unset option.
Browse files Browse the repository at this point in the history
Error printed to console is:

    AttributeError: 'Options' object has no attribute 'enable_emphasis'
    Exception occurred: 'Options' object has no attribute 'enable_emphasis'

Ref: kabachuha#243
  • Loading branch information
mattcaron committed Oct 15, 2024
1 parent a4caebe commit 69fc371
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/modelscope/clip_hardcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down

0 comments on commit 69fc371

Please sign in to comment.