Skip to content

Commit

Permalink
pre-commit hook tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl-Johan Alm committed Oct 4, 2023
1 parent 01528e7 commit 5e071b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/axolotl/prompt_strategies/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def tokenize_prompt(self, prompt):
full_prompt = self._build_full_prompt(instruction, None, None)
tokenized_full_prompt = self._tokenize(full_prompt)
steps = self.sequence_len - self.overlap_len
if steps < 1: raise ValueError("Sequence length must be greater than overlap length")
if steps < 1:
raise ValueError("Sequence length must be greater than overlap length")

for key, val in tokenized_full_prompt.items():
for i in range(0, len(val), steps):
Expand Down
14 changes: 12 additions & 2 deletions src/axolotl/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ def load_tokenized_prepared_datasets(
str(cfg.sequence_len)
+ "@"
+ "|".join(
sorted([f"{d.path}:{d.type}:{d.shards}:{d.overlap_len}" for d in cfg.datasets])
sorted(
[
f"{d.path}:{d.type}:{d.shards}:{d.overlap_len}"
for d in cfg.datasets
]
)
)
+ "|"
+ tokenizer_name
Expand Down Expand Up @@ -395,7 +400,12 @@ def load_prepare_datasets(
+ str(max_packed_sequence_len)
+ seed
+ "|".join(
sorted([f"{d.path}:{d.type}:{d.shards}:{d.overlap_len}" for d in cfg.datasets])
sorted(
[
f"{d.path}:{d.type}:{d.shards}:{d.overlap_len}"
for d in cfg.datasets
]
)
)
+ "|"
+ tokenizer_name
Expand Down

0 comments on commit 5e071b2

Please sign in to comment.