This commit is contained in:
Haoming 2026-05-29 10:10:36 +08:00
parent 1a03991313
commit 5bcf85a532
10 changed files with 10 additions and 10 deletions

View File

@ -21,7 +21,7 @@ class PromptChunk:
class AnimaTextProcessingEngine:
def __init__(self, text_encoder, qwen_tokenizer, t5_tokenizer):
super().__init__()
self.emphasis = emphasis.get_current_option(opts.emphasis)()
self.text_encoder: "Qwen3_06B" = text_encoder
self.qwen_tokenizer = qwen_tokenizer

View File

@ -51,7 +51,7 @@ class CLIPEmbeddingForTextualInversion(torch.nn.Module):
class ClassicTextProcessingEngine:
def __init__(self, text_encoder, tokenizer, chunk_length=75, embedding_dir=None, embedding_key="clip_l", embedding_expected_shape=768, text_projection=False, minimal_clip_skip=1, clip_skip=1, return_pooled=False, final_layer_norm=True):
super().__init__()
self.emphasis = emphasis.get_current_option(opts.emphasis)()
self.embeddings = EmbeddingDatabase(tokenizer, embedding_expected_shape)

View File

@ -22,7 +22,7 @@ class PromptChunk:
class GemmaTextProcessingEngine:
def __init__(self, text_encoder, tokenizer):
super().__init__()
self.emphasis = emphasis.get_current_option(opts.emphasis)()
self.text_encoder = text_encoder
self.tokenizer = tokenizer

View File

@ -22,7 +22,7 @@ class PromptChunk:
class KleinTextProcessingEngine:
def __init__(self, text_encoder, tokenizer):
super().__init__()
self.emphasis = emphasis.get_current_option(opts.emphasis)()
self.text_encoder = text_encoder
self.tokenizer = tokenizer

View File

@ -16,7 +16,7 @@ class PromptChunk:
class Ministral3TextProcessingEngine:
def __init__(self, text_encoder, tokenizer):
super().__init__()
self.emphasis = emphasis.EmphasisNone()
self.text_encoder = text_encoder
self.tokenizer = tokenizer

View File

@ -22,7 +22,7 @@ re_attention = re.compile(
re_break = re.compile(r"\s*\bBREAK\b\s*", re.S)
def parse_prompt_attention(text, emphasis):
def parse_prompt_attention(text: str, emphasis: str):
res = []
round_brackets = []
square_brackets = []

View File

@ -22,7 +22,7 @@ class PromptChunk:
class Qwen3TextProcessingEngine:
def __init__(self, text_encoder, tokenizer):
super().__init__()
self.emphasis = emphasis.get_current_option(opts.emphasis)()
self.text_encoder = text_encoder
self.tokenizer = tokenizer

View File

@ -17,7 +17,7 @@ class PromptChunk:
class QwenTextProcessingEngine:
def __init__(self, text_encoder, tokenizer):
super().__init__()
self.emphasis = emphasis.get_current_option(opts.emphasis)()
self.text_encoder = text_encoder
self.tokenizer = tokenizer

View File

@ -14,7 +14,7 @@ class PromptChunk:
class T5TextProcessingEngine:
def __init__(self, text_encoder, tokenizer, min_length: int = 256, min_padding: int = -1):
super().__init__()
self.emphasis = emphasis.get_current_option(opts.emphasis)()
self.text_encoder = text_encoder.transformer
self.tokenizer = tokenizer

View File

@ -17,7 +17,7 @@ class PromptChunk:
class UMT5TextProcessingEngine:
def __init__(self, text_encoder, tokenizer, min_length=512):
super().__init__()
self.emphasis = emphasis.get_current_option(opts.emphasis)()
self.text_encoder = text_encoder.transformer
self.tokenizer = tokenizer