diff --git a/examples/causal_language_modeling/peft_prefix_tuning_clm.ipynb b/examples/causal_language_modeling/peft_prefix_tuning_clm.ipynb index eb25c0c20a..cf36d219e2 100644 --- a/examples/causal_language_modeling/peft_prefix_tuning_clm.ipynb +++ b/examples/causal_language_modeling/peft_prefix_tuning_clm.ipynb @@ -1180,9 +1180,9 @@ " tokenizer.batch_decode(torch.argmax(outputs.logits, -1).detach().cpu().numpy(), skip_special_tokens=True)\n", " )\n", "\n", - " eval_epoch_loss = eval_loss / len(train_dataloader)\n", + " eval_epoch_loss = eval_loss / len(eval_dataloader)\n", " eval_ppl = torch.exp(eval_epoch_loss)\n", - " train_epoch_loss = total_loss / len(eval_dataloader)\n", + " train_epoch_loss = total_loss / len(train_dataloader)\n", " train_ppl = torch.exp(train_epoch_loss)\n", " print(f\"{epoch=}: {train_ppl=} {train_epoch_loss=} {eval_ppl=} {eval_epoch_loss=}\")" ] @@ -1345,7 +1345,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.5 (v3.10.5:f377153967, Jun 6 2022, 12:36:10) [Clang 13.0.0 (clang-1300.0.29.30)]" + "version": "3.10.5" }, "vscode": { "interpreter": { diff --git a/examples/causal_language_modeling/peft_prompt_tuning_clm.ipynb b/examples/causal_language_modeling/peft_prompt_tuning_clm.ipynb index e5ba39b9e4..e289206110 100644 --- a/examples/causal_language_modeling/peft_prompt_tuning_clm.ipynb +++ b/examples/causal_language_modeling/peft_prompt_tuning_clm.ipynb @@ -1022,9 +1022,9 @@ " tokenizer.batch_decode(torch.argmax(outputs.logits, -1).detach().cpu().numpy(), skip_special_tokens=True)\n", " )\n", "\n", - " eval_epoch_loss = eval_loss / len(train_dataloader)\n", + " eval_epoch_loss = eval_loss / len(eval_dataloader)\n", " eval_ppl = torch.exp(eval_epoch_loss)\n", - " train_epoch_loss = total_loss / len(eval_dataloader)\n", + " train_epoch_loss = total_loss / len(train_dataloader)\n", " train_ppl = torch.exp(train_epoch_loss)\n", " print(f\"{epoch=}: {train_ppl=} {train_epoch_loss=} {eval_ppl=} {eval_epoch_loss=}\")" ] @@ -1185,7 +1185,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.5 (v3.10.5:f377153967, Jun 6 2022, 12:36:10) [Clang 13.0.0 (clang-1300.0.29.30)]" + "version": "3.10.5" }, "vscode": { "interpreter": { diff --git a/examples/conditional_generation/peft_lora_seq2seq.ipynb b/examples/conditional_generation/peft_lora_seq2seq.ipynb index f22d3c66b1..6cbd4f1cb9 100644 --- a/examples/conditional_generation/peft_lora_seq2seq.ipynb +++ b/examples/conditional_generation/peft_lora_seq2seq.ipynb @@ -324,9 +324,9 @@ " tokenizer.batch_decode(torch.argmax(outputs.logits, -1).detach().cpu().numpy(), skip_special_tokens=True)\n", " )\n", "\n", - " eval_epoch_loss = eval_loss / len(train_dataloader)\n", + " eval_epoch_loss = eval_loss / len(eval_dataloader)\n", " eval_ppl = torch.exp(eval_epoch_loss)\n", - " train_epoch_loss = total_loss / len(eval_dataloader)\n", + " train_epoch_loss = total_loss / len(train_dataloader)\n", " train_ppl = torch.exp(train_epoch_loss)\n", " print(f\"{epoch=}: {train_ppl=} {train_epoch_loss=} {eval_ppl=} {eval_epoch_loss=}\")" ] @@ -473,7 +473,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.4" + "version": "3.10.5" }, "vscode": { "interpreter": { diff --git a/examples/conditional_generation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py b/examples/conditional_generation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py index cef97734c2..a2d0d201da 100644 --- a/examples/conditional_generation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py +++ b/examples/conditional_generation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py @@ -217,7 +217,7 @@ def collate_fn(examples): tracemalloc.cpu_peaked + b2mb(tracemalloc.cpu_begin) ) ) - train_epoch_loss = total_loss / len(eval_dataloader) + train_epoch_loss = total_loss / len(train_dataloader) train_ppl = torch.exp(train_epoch_loss) accelerator.print(f"{epoch=}: {train_ppl=} {train_epoch_loss=}") diff --git a/examples/conditional_generation/peft_lora_seq2seq_accelerate_fsdp.py b/examples/conditional_generation/peft_lora_seq2seq_accelerate_fsdp.py index e00b1ff588..c011dbb959 100644 --- a/examples/conditional_generation/peft_lora_seq2seq_accelerate_fsdp.py +++ b/examples/conditional_generation/peft_lora_seq2seq_accelerate_fsdp.py @@ -108,9 +108,9 @@ def preprocess_function(examples): eval_loss += loss.detach().float() preds = accelerator.gather_for_metrics(torch.argmax(outputs.logits, -1)).detach().cpu().numpy() eval_preds.extend(tokenizer.batch_decode(preds, skip_special_tokens=True)) - eval_epoch_loss = eval_loss / len(train_dataloader) + eval_epoch_loss = eval_loss / len(eval_dataloader) eval_ppl = torch.exp(eval_epoch_loss) - train_epoch_loss = total_loss / len(eval_dataloader) + train_epoch_loss = total_loss / len(train_dataloader) train_ppl = torch.exp(train_epoch_loss) accelerator.print(f"{epoch=}: {train_ppl=} {train_epoch_loss=} {eval_ppl=} {eval_epoch_loss=}") diff --git a/examples/conditional_generation/peft_prefix_tuning_seq2seq.ipynb b/examples/conditional_generation/peft_prefix_tuning_seq2seq.ipynb index dde8fff277..aa85f9a743 100644 --- a/examples/conditional_generation/peft_prefix_tuning_seq2seq.ipynb +++ b/examples/conditional_generation/peft_prefix_tuning_seq2seq.ipynb @@ -360,9 +360,9 @@ " tokenizer.batch_decode(torch.argmax(outputs.logits, -1).detach().cpu().numpy(), skip_special_tokens=True)\n", " )\n", "\n", - " eval_epoch_loss = eval_loss / len(train_dataloader)\n", + " eval_epoch_loss = eval_loss / len(eval_dataloader)\n", " eval_ppl = torch.exp(eval_epoch_loss)\n", - " train_epoch_loss = total_loss / len(eval_dataloader)\n", + " train_epoch_loss = total_loss / len(train_dataloader)\n", " train_ppl = torch.exp(train_epoch_loss)\n", " print(f\"{epoch=}: {train_ppl=} {train_epoch_loss=} {eval_ppl=} {eval_epoch_loss=}\")" ] @@ -503,7 +503,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.5 (v3.10.5:f377153967, Jun 6 2022, 12:36:10) [Clang 13.0.0 (clang-1300.0.29.30)]" + "version": "3.10.5" }, "vscode": { "interpreter": {