From ec062e1099521bc67b903b4505f591037857cbd8 Mon Sep 17 00:00:00 2001 From: Sebastian Raschka Date: Fri, 18 Apr 2025 17:20:56 -0500 Subject: [PATCH] Dpo vocab size clarification (#628) * Llama3 from scratch improvements * vocab size should be 50257 not 50256 * restore --- ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb b/ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb index 59e9d36..79ab073 100644 --- a/ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb +++ b/ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb @@ -2140,7 +2140,7 @@ }, "source": [ "- In other words, `torch.gather` is a selection function\n", - "- When we computed the loss earlier, we used it to retrieve the log probabilities corresponding to the correct token in the 50,256-token vocabulary\n", + "- When we computed the loss earlier, we used it to retrieve the log probabilities corresponding to the correct token in the 50,257-token vocabulary\n", "- The \"correct\" tokens are the tokens given in the response entry" ] }, @@ -3112,7 +3112,7 @@ "provenance": [] }, "kernelspec": { - "display_name": ".venv", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -3126,7 +3126,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.6" + "version": "3.10.16" } }, "nbformat": 4,