From 2e3307d763beeed4f125f502eb9cf36b381c28cf Mon Sep 17 00:00:00 2001 From: Ryan Mullins Date: Fri, 15 Nov 2024 14:47:38 +0000 Subject: [PATCH] Fixes #12. Sets pad_token_id to eos_token_id for GPT-2 --- notebooks/synthid_text_huggingface_integration.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/notebooks/synthid_text_huggingface_integration.ipynb b/notebooks/synthid_text_huggingface_integration.ipynb index b2f7ed5..7925090 100644 --- a/notebooks/synthid_text_huggingface_integration.ipynb +++ b/notebooks/synthid_text_huggingface_integration.ipynb @@ -206,6 +206,7 @@ " else transformers.GPT2LMHeadModel\n", " )\n", " model = model_cls.from_pretrained(model_name.value, device_map='auto')\n", + " model.generation_config.pad_token_id = model.generation_config.eos_token_id\n", " else:\n", " model_cls = (\n", " synthid_mixin.SynthIDGemmaForCausalLM\n",