Azure / Azure/azureml-examples
Foundation Model - Text Classification - doesn't have a 'stream' key error
- Dominant language
- Jupyter Notebook
- Stars
- 2k
- Forks
- 1.7k
- Avg merge
- 18h 18m
- Merged PRs (30d)
- 2
Description
### Operating System
Linux
### Version Information
Python Version:
azure-ai-ml
### Steps to reproduce
1. Run following notebook: azureml-examples/sdk/python/foundation-models/system/inference/text-classification/entailment-contradiction-batch.ipynb
2. Verify error in cell 14 : testdata = datasets.load_dataset("glue", "mnli", split="train", stream=True)
### Expected behavior
Cell executes successfully
### Actual behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Input In [14], in ()
----> 1 testdata = datasets.load_dataset("glue", "mnli", split="train", stream=True)
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/datasets/load.py:727, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, script_version, use_auth_token, task, **config_kwargs)
724 builder_cls = import_main_class(module_path, dataset=True)
726 # Instantiate the dataset builder
--> 727 builder_instance: DatasetBuilder = builder_cls(
728 cache_dir=cache_dir,
729 name=name,
730 data_dir=data_dir,
731 data_files=data_files,
732 hash=hash,
733 features=features,
734 **config_kwargs,
735 )
737 # Some datasets are already processed on the HF google storage
738 # Don't try downloading from google storage for the packaged datasets as text, json, csv or pandas
739 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/datasets/builder.py:932, in GeneratorBasedBuilder.__init__(self, writer_batch_size, *args, **kwargs)
931 def __init__(self, *args, writer_batch_size=None, **kwargs):
--> 932 super(GeneratorBasedBuilder, self).__init__(*args, **kwargs)
933 # Batch size used by the ArrowWriter
934 # It defines the number of samples that are kept in memory before writing them
935 # and also the length of the arrow chunks
936 # None means that the ArrowWriter will use its default value
937 self._writer_batch_size = writer_batch_size or self.DEFAULT_WRITER_BATCH_SIZE
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/datasets/builder.py:234, in DatasetBuilder.__init__(self, cache_dir, name, hash, features, **config_kwargs)
232 if "features" in inspect.signature(self.BUILDER_CONFIG_CLASS.__init__).parameters and features is not None:
233 config_kwargs["features"] = features
--> 234 self.config, self.config_id = self._create_builder_config(
235 name,
236 custom_features=features,
237 **config_kwargs,
238 )
240 # prepare info: DatasetInfo are a standardized dataclass across all datasets
241 # Prefill datasetinfo
242 info = self.get_exported_dataset_info()
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/datasets/builder.py:341, in DatasetBuilder._create_builder_config(self, name, custom_features, **config_kwargs)
339 if value is not None:
340 if not hasattr(builder_config, key):
--> 341 raise ValueError(f"BuilderConfig {builder_config} doesn't have a '{key}' key.")
342 setattr(builder_config, key, value)
344 if not builder_config.name:
ValueError: BuilderConfig GlueConfig(name='mnli', version=1.0.0, data_dir='MNLI', data_files=None, description='The Multi-Genre Natural Language Inference Corpus is a crowdsourced\ncollection of sentence pairs with textual entailment annotations. Given a premise sentence\nand a hypothesis sentence, the task is to predict whether the premise entails the hypothesis\n(entailment), contradicts the hypothesis (contradiction), or neither (neutral). The premise sentences are\ngathered from ten different sources, including transcribed speech, fiction, and government reports.\nWe use the standard test set, for which we obtained private labels from the authors, and evaluate\non both the matched (in-domain) and mismatched (cross-domain) section. We also use and recommend\nthe SNLI corpus as 550k examples of auxiliary training data.') doesn't have a 'stream' key.
### Addition information
_No response_
Contributor guide
Research direction
Open azureml-examples/sdk/python/foundation-models/system/inference/text-classification/entailment-contradiction-batch.ipynb and inspect cell 14, especially the datasets.load_dataset call. Reproduce the reported ValueError in the stated Python environment and determine the compatible usage for the example. Done means the cell executes successfully without the missing 'stream' key error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100