Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt committed Jun 21, 2024
1 parent 6c0dc23 commit 4c2b503
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ch07/01_main-chapter-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Validation set length: 55
Test set length: 110
--------------------------------------------------
Device: cpu
--------------------------------------------------
File already exists and is up-to-date: gpt2/355M/checkpoint
File already exists and is up-to-date: gpt2/355M/encoder.json
File already exists and is up-to-date: gpt2/355M/hparams.json
Expand All @@ -50,7 +51,7 @@ Training completed in 15.66 minutes.
Plot saved as loss-plot-standalone.pdf
--------------------------------------------------
Generating responses
100%|██████████████████████████████████████████████████████████████████████████| 110/110 [06:57<00:00, 3.80s/it]
100%|█████████████████████████████████████████████████████████| 110/110 [06:57<00:00, 3.80s/it]
Responses saved as instruction-data-with-response-standalone.json
Model saved as gpt2-medium355M-sft-standalone.pth
```
Expand Down
2 changes: 2 additions & 0 deletions ch07/01_main-chapter-code/gpt_instruction_finetuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ def main():
tokenizer = tiktoken.get_encoding("gpt2")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print("Device:", device)
print(50*"-")

customized_collate_fn = partial(custom_collate_fn, device=device, allowed_max_length=1024)

num_workers = 0
Expand Down

0 comments on commit 4c2b503

Please sign in to comment.