Skip to content

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
deepdelirious committed Nov 6, 2024
1 parent edf42d6 commit 0173443
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flux_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ def inject_embedding(model, tokenizer, placeholder, embed_file, embed_key):
index = tokenizer.convert_tokens_to_ids(placeholder)
if (model.get_input_embeddings().num_embeddings <= len(tokenizer)):
model.resize_token_embeddings(len(tokenizer))
print(f"Expanded model embeddings to : {model.get_input_embeddings().num_embeddings}")
logger.info(f"Expanded model embeddings to : {model.get_input_embeddings().num_embeddings}")
model.get_input_embeddings().weight.data[index] = embed_state_dict[embed_key]
print(f"Added custom embedding for {placeholder} to {embed_key} as token {index}")
logger.info(f"Added custom embedding for {placeholder} to {embed_key} as token {index}")

# load clip_l, t5xxl for caching text encoder outputs
clip_l = flux_utils.load_clip_l(args.clip_l, weight_dtype, "cpu", args.disable_mmap_load_safetensors)
Expand Down

0 comments on commit 0173443

Please sign in to comment.