Performance fixes and bug fixes
This commit is contained in:
@@ -98,12 +98,21 @@ class Flux2Model(BaseModel):
|
||||
self.print_and_status_update("Loading Mistral")
|
||||
|
||||
# load + quantize + offload + placement, all driven by model_config
|
||||
# tie_word_embeddings=False: the checkpoint carries both embed_tokens
|
||||
# and lm_head with different values; the config's tie claim is wrong
|
||||
text_encoder = Mistral3TextEncoder.load(
|
||||
MISTRAL_PATH, subfolder="", **self.component_load_kwargs("te")
|
||||
MISTRAL_PATH,
|
||||
subfolder="",
|
||||
tie_word_embeddings=False,
|
||||
**self.component_load_kwargs("te"),
|
||||
)
|
||||
flush()
|
||||
|
||||
tokenizer = AutoProcessor.from_pretrained(MISTRAL_PATH)
|
||||
# fix_mistral_regex=False: keep the exact tokenization flux2 has always
|
||||
# used (True would change the pre-tokenizer and shift conditioning)
|
||||
tokenizer = AutoProcessor.from_pretrained(
|
||||
MISTRAL_PATH, fix_mistral_regex=False
|
||||
)
|
||||
return text_encoder, tokenizer
|
||||
|
||||
def load_model(self):
|
||||
|
||||
Reference in New Issue
Block a user