Merge pull request #40 from KrenarShabani/bugfix-issue-39

Fixes #39: checks if text is a tuple and converts it to a string
This commit is contained in:
nkchocoai
2024-08-27 22:49:54 +09:00
committed by GitHub
+2
View File
@@ -72,6 +72,8 @@ def _extract_embedding_names(text, input_data):
tokenizer = tokenizer.clip_h
elif isinstance(tokenizer, SDXLTokenizer):
tokenizer = tokenizer.clip_l
if not isinstance(text,str):
text = "".join(str(item) if item is not None else "" for item in text)
text = escape_important(text)
parsed_weights = token_weights(text, 1.0)