From 5fbeb1a2709015a7fc81a0de890605e2f8acc359 Mon Sep 17 00:00:00 2001 From: Aleksey Morozov <36787333+amrzv@users.noreply.github.com> Date: Sun, 8 Jun 2025 11:30:43 +0200 Subject: [PATCH 1/2] Fix datasets version --- requirements-data.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-data.txt b/requirements-data.txt index 5546b22a..adc58914 100644 --- a/requirements-data.txt +++ b/requirements-data.txt @@ -1,4 +1,4 @@ -datasets +datasets==2.15.0 datatrove==0.2.0 huggingface_hub==0.23.1 pyyaml From 344734ee13cf8ca96b1c1a47d72ae65efd15bc13 Mon Sep 17 00:00:00 2001 From: Aleksey Morozov <36787333+amrzv@users.noreply.github.com> Date: Sun, 8 Jun 2025 11:31:08 +0200 Subject: [PATCH 2/2] Replace compile= by reference_compile= --- examples/finetune_modernbert_on_glue.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/finetune_modernbert_on_glue.ipynb b/examples/finetune_modernbert_on_glue.ipynb index e4862863..04939418 100644 --- a/examples/finetune_modernbert_on_glue.ipynb +++ b/examples/finetune_modernbert_on_glue.ipynb @@ -42,7 +42,7 @@ "metadata": {}, "outputs": [], "source": [ - "#! pip install transformers datasets accelerate scikit-learn -Uqq\n" + "#! pip install transformers datasets==2.15.0 accelerate scikit-learn -Uqq\n" ] }, { @@ -706,7 +706,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "When configuring `AutoModelForSequenceClassification`, two settings are critical to get things working with the HuggingFace `Trainer`. One is the `num_labels` we're expecting and the other is to set `compile=False` to avoid using the `torch.compile` function which is not supported in Transformers at the time of this writing." + "When configuring `AutoModelForSequenceClassification`, two settings are critical to get things working with the HuggingFace `Trainer`. One is the `num_labels` we're expecting and the other is to set `reference_compile=False` to avoid using the `torch.compile` function which is not supported in Transformers at the time of this writing." ] }, { @@ -725,7 +725,7 @@ ], "source": [ "hf_model = AutoModelForSequenceClassification.from_pretrained(\n", - " checkpoint, num_labels=n_labels, id2label=id2label, label2id=label2id, compile=False\n", + " checkpoint, num_labels=n_labels, id2label=id2label, label2id=label2id, reference_compile=False\n", ")\n" ] }, @@ -1167,7 +1167,7 @@ " # 5. Load the model and data collator\n", " model_additional_kwargs = {\"id2label\": id2label, \"label2id\": label2id} if id2label and label2id else {}\n", " hf_model = AutoModelForSequenceClassification.from_pretrained(\n", - " checkpoint, num_labels=n_labels, compile=False, **model_additional_kwargs\n", + " checkpoint, num_labels=n_labels, reference_compile=False, **model_additional_kwargs\n", " )\n", "\n", " hf_data_collator = DataCollatorWithPadding(tokenizer=hf_tokenizer)\n",