Fix CI with change of name of nlp (#7054)

* nlp -> datasets

* More nlp -> datasets

* Woopsie

* More nlp -> datasets

* One last
This commit is contained in:
Sylvain Gugger
2020-09-10 14:51:08 -04:00
committed by GitHub
parent e9a2f772bc
commit 514486739c
13 changed files with 42 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
import unittest
import nlp
import datasets
import numpy as np
from transformers import AutoTokenizer, TrainingArguments, is_torch_available
@@ -200,11 +200,11 @@ class TrainerIntegrationTest(unittest.TestCase):
x = trainer.eval_dataset.x
self.assertTrue(np.allclose(preds, 1.5 * x + 2.5))
def test_trainer_with_nlp(self):
def test_trainer_with_datasets(self):
np.random.seed(42)
x = np.random.normal(size=(64,)).astype(np.float32)
y = 2.0 * x + 3.0 + np.random.normal(scale=0.1, size=(64,))
train_dataset = nlp.Dataset.from_dict({"input_x": x, "label": y})
train_dataset = datasets.Dataset.from_dict({"input_x": x, "label": y})
# Base training. Should have the same results as test_reproducible_training
model = RegressionModel()
@@ -222,7 +222,7 @@ class TrainerIntegrationTest(unittest.TestCase):
# Adding one column not used by the model should have no impact
z = np.random.normal(size=(64,)).astype(np.float32)
train_dataset = nlp.Dataset.from_dict({"input_x": x, "label": y, "extra": z})
train_dataset = datasets.Dataset.from_dict({"input_x": x, "label": y, "extra": z})
model = RegressionModel()
trainer = Trainer(model, args, train_dataset=train_dataset)
trainer.train()