mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-10 08:17:44 +08:00
Allow custom templates with Ideogram4 TE (#14374)
This commit is contained in:
parent
f89999289a
commit
8ed7f458d0
@ -32,7 +32,9 @@ class Ideogram4Tokenizer(sd1_clip.SD1Tokenizer):
|
||||
self.llama_template = "<|im_start|>user\n{}<|im_end|>\n<|im_start|>assistant\n"
|
||||
|
||||
def tokenize_with_weights(self, text, return_word_ids=False, llama_template=None, **kwargs):
|
||||
if llama_template is None:
|
||||
if text.startswith('<|im_start|>'):
|
||||
llama_text = text
|
||||
elif llama_template is None:
|
||||
llama_text = self.llama_template.format(text)
|
||||
else:
|
||||
llama_text = llama_template.format(text)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user