Re-export KeyDataset. (#15645)

* Re-export `KeyDataset`.

* Update the docs locations.
This commit is contained in:
Nicolas Patry
2022-02-15 17:49:38 +01:00
committed by GitHub
parent 28e6155d8a
commit cdf19c501d
3 changed files with 7 additions and 4 deletions

View File

@@ -118,7 +118,7 @@ Next, load a dataset (see the 🤗 Datasets [Quick Start](https://huggingface.co
Now you can iterate over the dataset with the pipeline. `KeyDataset` retrieves the item in the dictionary returned by the dataset:
```py
>>> from transformers.pipelines.base import KeyDataset
>>> from transformers.pipelines.pt_utils import KeyDataset
>>> from tqdm.auto import tqdm
>>> for out in tqdm(speech_recognizer(KeyDataset(dataset, "file"))):
@@ -316,4 +316,4 @@ One particularly cool 🤗 Transformers feature is the ability to save a model a
>>> tokenizer = AutoTokenizer.from_pretrained(pt_save_directory)
>>> tf_model = TFAutoModelForSequenceClassification.from_pretrained(pt_save_directory, from_pt=True)
```
```