Skip to content

Commit

Permalink
Hermes Checkpoint creation
Browse files Browse the repository at this point in the history
  • Loading branch information
acebot712 committed Jul 19, 2024
1 parent a367c1a commit f1ed60c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 79 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -827,3 +827,4 @@ models/
# Do not ignore scripts directory
!scripts/
scripts/MergeKit
scripts/test.py
6 changes: 3 additions & 3 deletions scripts/data_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ def prepare_dataset(

if __name__ == "__main__":
dataset_name = "teknium/OpenHermes-2.5"
tokenizer_name = "microsoft/Phi-3-mini-4k-instruct"
tokenizer_name = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"

tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct", padding=True, truncation=True)
tokenizer = AutoTokenizer.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0", padding=True, truncation=True)
tokenizer.pad_token = tokenizer.eos_token
tokenizer.padding_side = "left"
tokenizer.padding_side = "right"

prepared_dataset = prepare_dataset(dataset_name, tokenizer, sample_percentage=1)

Expand Down
4 changes: 2 additions & 2 deletions scripts/sft.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def initialize_model_and_tokenizer():

def load_dataset():
try:
dataset = load_from_disk("data/sft_mmlu")
dataset = load_from_disk("data/sft")
logger.info("Dataset loaded from disk.")
return dataset
except Exception as e:
Expand Down Expand Up @@ -108,7 +108,7 @@ def main():
model, tokenizer = initialize_model_and_tokenizer()

dataset = load_dataset()
train_dataset = dataset["auxiliary_train"]
train_dataset = dataset["train"]
eval_dataset = dataset["test"]

trainer = prepare_trainer(model, tokenizer, train_dataset, eval_dataset)
Expand Down
74 changes: 0 additions & 74 deletions scripts/test.py

This file was deleted.

0 comments on commit f1ed60c

Please sign in to comment.