[Examples] Added context manager to datasets map (#12367)
* added cotext manager to datasets map * fixed style and spaces * fixed warning of deprecation * changed desc
This commit is contained in:
@@ -503,7 +503,7 @@ def main():
|
||||
|
||||
for test_dataset, task in zip(test_datasets, tasks):
|
||||
# Removing the `label` columns because it contains -1 and Trainer won't like that.
|
||||
test_dataset.remove_columns_("label")
|
||||
test_dataset = test_dataset.remove_columns("label")
|
||||
predictions = trainer.predict(test_dataset=test_dataset).predictions
|
||||
predictions = np.squeeze(predictions) if is_regression else np.argmax(predictions, axis=1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user