Skip to content

Commit

Permalink
Merge branch 'main' into abm-corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
metric-space authored Aug 8, 2024
2 parents ca71aa3 + f086664 commit a381c5a
Show file tree
Hide file tree
Showing 2 changed files with 452 additions and 131 deletions.
10 changes: 9 additions & 1 deletion mergekit/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ def generate_card_lora(
base_model_ref: ModelReference,
finetuned_model_ref: ModelReference,
invocation: str,
extended: bool,
vocab_size: int,
name: str,
) -> str:
"""
Expand All @@ -218,7 +220,13 @@ def generate_card_lora(
hf_bases = list(extract_hf_paths([base_model_ref, finetuned_model_ref]))
tags = ["mergekit", "peft"]

details = f"This LoRA adapter was extracted from {modelref_md(finetuned_model_ref)} and uses {modelref_md(base_model_ref)} as a base."
finetuned_ref_md = modelref_md(finetuned_model_ref)
basemodel_ref_md = modelref_md(base_model_ref)

details = f"This LoRA adapter was extracted from {finetuned_ref_md} and uses {basemodel_ref_md} as a base."

if extended:
details += f"\n\n> [!WARNING]\n> This LoRA adapter has an extended vocabulary. Make sure to call `model.resize_token_embeddings({vocab_size})` before applying the adapter to {basemodel_ref_md}"

if os.path.isdir(base_model_ref.model.path) or os.path.isdir(
finetuned_model_ref.model.path
Expand Down
Loading

0 comments on commit a381c5a

Please sign in to comment.