Skip to content

Commit

Permalink
Fix Notebook01 Dataset column_rename (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpollmann committed May 10, 2023
1 parent db09025 commit 1ae5287
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions notebooks/01_Adapter_Training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
"# Encode the input data\n",
"dataset = dataset.map(encode_batch, batched=True)\n",
"# The transformers model expects the target class column to be named \"labels\"\n",
"dataset.rename_column_(\"label\", \"labels\")\n",
"dataset = dataset.rename_column(\"label\", \"labels\")\n",
"# Transform to pytorch tensors and only output the required columns\n",
"dataset.set_format(type=\"torch\", columns=[\"input_ids\", \"attention_mask\", \"labels\"])"
]
Expand Down Expand Up @@ -4209,4 +4209,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
4 changes: 2 additions & 2 deletions notebooks/03_Adapter_Fusion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
"# Encode the input data\n",
"dataset = dataset.map(encode_batch, batched=True)\n",
"# The transformers model expects the target class column to be named \"labels\"\n",
"dataset.rename_column_(\"label\", \"labels\")\n",
"dataset = dataset.rename_column(\"label\", \"labels\")\n",
"# Transform to pytorch tensors and only output the required columns\n",
"dataset.set_format(type=\"torch\", columns=[\"input_ids\", \"attention_mask\", \"labels\"])"
]
Expand Down Expand Up @@ -728,4 +728,4 @@
},
"nbformat": 4,
"nbformat_minor": 1
}
}
2 changes: 1 addition & 1 deletion notebooks/04_Cross_Lingual_Transfer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
" # Encode the input data\n",
" dataset = dataset.map(encode_batch, batched=True)\n",
" # The transformers model expects the target class column to be named \"labels\"\n",
" dataset.rename_column_(\"label\", \"labels\")\n",
" dataset = dataset.rename_column(\"label\", \"labels\")\n",
" # Transform to pytorch tensors and only output the required columns\n",
" dataset.set_format(columns=[\"input_ids\", \"attention_mask\", \"labels\"])\n",
" return dataset\n",
Expand Down
4 changes: 2 additions & 2 deletions notebooks/05_Adapter_Drop_Training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
"# Encode the input data\n",
"dataset = dataset.map(encode_batch, batched=True)\n",
"# The transformers model expects the target class column to be named \"labels\"\n",
"dataset.rename_column_(\"label\", \"labels\")\n",
"dataset = dataset.rename_column(\"label\", \"labels\")\n",
"# Transform to pytorch tensors and only output the required columns\n",
"dataset.set_format(type=\"torch\", columns=[\"input_ids\", \"attention_mask\", \"labels\"])"
]
Expand Down Expand Up @@ -475,4 +475,4 @@
},
"nbformat": 4,
"nbformat_minor": 1
}
}

0 comments on commit 1ae5287

Please sign in to comment.