Skip to content

Fix notebook #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/finetune_modernbert_on_glue.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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."
]
},
{
Expand All @@ -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"
]
},
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion requirements-data.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
datasets
datasets==2.15.0
datatrove==0.2.0
huggingface_hub==0.23.1
pyyaml
Expand Down