Skip to content

Commit

Permalink
Explicit auth for finetuning
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexejPenner committed Oct 31, 2024
1 parent 5a01673 commit 0bce2f4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions llm-complete-guide/steps/finetune_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
DATASET_NAME_DISTILABEL,
EMBEDDINGS_MODEL_ID_BASELINE,
EMBEDDINGS_MODEL_ID_FINE_TUNED,
EMBEDDINGS_MODEL_MATRYOSHKA_DIMS,
EMBEDDINGS_MODEL_MATRYOSHKA_DIMS, SECRET_NAME,
)
from datasets import DatasetDict, concatenate_datasets, load_dataset
from datasets.arrow_dataset import Dataset
Expand Down Expand Up @@ -288,8 +288,13 @@ def finetune(
)

trainer.train()

zenml_client = Client()

trainer.model.push_to_hub(
f"zenml/{EMBEDDINGS_MODEL_ID_FINE_TUNED}", exist_ok=True
f"zenml/{EMBEDDINGS_MODEL_ID_FINE_TUNED}",
exist_ok=True,
token=zenml_client.get_secret(SECRET_NAME).secret_values["hf_token"]
)

log_model_metadata(
Expand Down

0 comments on commit 0bce2f4

Please sign in to comment.