default config name doesn't work when config kwargs are specified.
CONTRIBUTOR
@lhoestq 
2023-08-16T04:38:42Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1679948682
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kIfuK
https://api.github.com/repos/huggingface/datasets/issues/comments/1679948682/reactions
2023-08-16T04:38:42Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1679948682
https://avatars.githubusercontent.com/u/11533479?v=4
https://api.github.com/users/npuichigo/events{/privacy}
https://api.github.com/users/npuichigo/followers
https://api.github.com/users/npuichigo/following{/other_user}
https://api.github.com/users/npuichigo/gists{/gist_id}
https://github.com/npuichigo
npuichigo
MDQ6VXNlcjExNTMzNDc5
https://api.github.com/users/npuichigo/orgs
https://api.github.com/users/npuichigo/received_events
https://api.github.com/users/npuichigo/repos
https://api.github.com/users/npuichigo/starred{/owner}{/repo}
https://api.github.com/users/npuichigo/subscriptions
User
https://api.github.com/users/npuichigo
public
MEMBER
What should be the behavior in this case ? Should it override the default config with the added parameter ?
2023-08-16T09:20:05Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1680258125
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kJrRN
https://api.github.com/repos/huggingface/datasets/issues/comments/1680258125/reactions
2023-08-16T09:20:05Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1680258125
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
I know why it should be treated as a new config if overriding parameters are passed. But in some case, I just pass in some common fields like `data_dir`.

For example, I want to extend the FolderBasedBuilder as a multi-config version, the `data_dir` or `data_files` are always passed by user and should not be considered as overriding the default config. In current state, I cannot leverage the feature of default config since passing `data_dir` will disable the default config.
2023-08-16T13:31:52Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1680613456
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kLCBQ
https://api.github.com/repos/huggingface/datasets/issues/comments/1680613456/reactions
2023-08-16T13:31:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1680613456
https://avatars.githubusercontent.com/u/11533479?v=4
https://api.github.com/users/npuichigo/events{/privacy}
https://api.github.com/users/npuichigo/followers
https://api.github.com/users/npuichigo/following{/other_user}
https://api.github.com/users/npuichigo/gists{/gist_id}
https://github.com/npuichigo
npuichigo
MDQ6VXNlcjExNTMzNDc5
https://api.github.com/users/npuichigo/orgs
https://api.github.com/users/npuichigo/received_events
https://api.github.com/users/npuichigo/repos
https://api.github.com/users/npuichigo/starred{/owner}{/repo}
https://api.github.com/users/npuichigo/subscriptions
User
https://api.github.com/users/npuichigo
public
MEMBER
Thinking more about it I think the current behavior is the right one.

Provided parameters should be passed to instantiate a new BuilderConfig.

What's the error you're getting ?
2023-08-16T13:42:25Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1680634500
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kLHKE
https://api.github.com/repos/huggingface/datasets/issues/comments/1680634500/reactions
2023-08-16T13:42:25Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1680634500
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
For example, this works to use default config with name '_all_':
```python
datasets.load_dataset("indonesian-nlp/librivox-indonesia", split="train")
```
while this failed to use default config
```python
datasets.load_dataset("indonesian-nlp/librivox-indonesia", split="train", data_dir='.')
```
After manually specifying it, it works again.
```python
datasets.load_dataset("indonesian-nlp/librivox-indonesia", "_all_", split="train", data_dir='.')
```
2023-08-16T15:46:44Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1680858603
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kL93r
https://api.github.com/repos/huggingface/datasets/issues/comments/1680858603/reactions
2023-08-16T15:46:44Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1680858603
https://avatars.githubusercontent.com/u/11533479?v=4
https://api.github.com/users/npuichigo/events{/privacy}
https://api.github.com/users/npuichigo/followers
https://api.github.com/users/npuichigo/following{/other_user}
https://api.github.com/users/npuichigo/gists{/gist_id}
https://github.com/npuichigo
npuichigo
MDQ6VXNlcjExNTMzNDc5
https://api.github.com/users/npuichigo/orgs
https://api.github.com/users/npuichigo/received_events
https://api.github.com/users/npuichigo/repos
https://api.github.com/users/npuichigo/starred{/owner}{/repo}
https://api.github.com/users/npuichigo/subscriptions
User
https://api.github.com/users/npuichigo
public
CONTRIBUTOR
@lhoestq 
2023-08-21T05:44:39Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1685687480
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5keYy4
https://api.github.com/repos/huggingface/datasets/issues/comments/1685687480/reactions
2023-08-21T05:44:39Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1685687480
https://avatars.githubusercontent.com/u/11533479?v=4
https://api.github.com/users/npuichigo/events{/privacy}
https://api.github.com/users/npuichigo/followers
https://api.github.com/users/npuichigo/following{/other_user}
https://api.github.com/users/npuichigo/gists{/gist_id}
https://github.com/npuichigo
npuichigo
MDQ6VXNlcjExNTMzNDc5
https://api.github.com/users/npuichigo/orgs
https://api.github.com/users/npuichigo/received_events
https://api.github.com/users/npuichigo/repos
https://api.github.com/users/npuichigo/starred{/owner}{/repo}
https://api.github.com/users/npuichigo/subscriptions
User
https://api.github.com/users/npuichigo
public
MEMBER
It should work if you explicitly ask for the config you want to override

```python
load_dataset('/dataset/with/multiple/config', 'name_of_the_default_config', some_field_in_config='some')
```

Alternatively you can have a BuilderConfig class that when instantiated returns a config with the right default values. In this case this code would instantiate this config with the default values except for the parameter to override:

```python
load_dataset('/dataset/with/multiple/config', some_field_in_config='some')
```
2023-08-21T09:52:24Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1686013428
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kfoX0
https://api.github.com/repos/huggingface/datasets/issues/comments/1686013428/reactions
2023-08-21T09:52:24Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1686013428
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
@lhoestq Yes. But it doesn't work for me.

Here's my dataset for example.
```
lass MyDatasetConfig(datasets.BuilderConfig):
    def __init__(self, name: str, version: str, **kwargs):
        self.option1 = kwargs.pop("option1", False)
        self.option2 = kwargs.pop("option2", 5)

        super().__init__(
            name=name,
            version=datasets.Version(version),
            **kwargs)


class MyDataset(datasets.GeneratorBasedBuilder):
    DEFAULT_CONFIG_NAME = "v1"

    BUILDER_CONFIGS = [
        UnifiedTtsDatasetConfig(
            name="v1",
            version="1.0.0",
            description="Initial version of the dataset"
        ),
    ]

    def _info(self) -> DatasetInfo:
        _ = self.option1
        ....
```

Here it's okay to use `load_dataset('my_dataset.py')` for loading the default config `v1`.

But if I want to override the default values in config with `load_dataset('my_dataset.py', option2=3)`, it failed to find my default config `v1.

Unless I use `load_dataset('my_dataset.py', 'v1', option2=3)`

So according to your advice, how can I modify my dataset to be able to override default config without manually specifying it.
2023-08-21T10:33:43Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1686074533
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kf3Sl
https://api.github.com/repos/huggingface/datasets/issues/comments/1686074533/reactions
2023-08-21T11:39:23Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1686074533
https://avatars.githubusercontent.com/u/11533479?v=4
https://api.github.com/users/npuichigo/events{/privacy}
https://api.github.com/users/npuichigo/followers
https://api.github.com/users/npuichigo/following{/other_user}
https://api.github.com/users/npuichigo/gists{/gist_id}
https://github.com/npuichigo
npuichigo
MDQ6VXNlcjExNTMzNDc5
https://api.github.com/users/npuichigo/orgs
https://api.github.com/users/npuichigo/received_events
https://api.github.com/users/npuichigo/repos
https://api.github.com/users/npuichigo/starred{/owner}{/repo}
https://api.github.com/users/npuichigo/subscriptions
User
https://api.github.com/users/npuichigo
public
MEMBER
What's the error ? It should try to instantiate `MyDatasetConfig` with `option2=3`
2023-08-21T10:46:48Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1686092295
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kf7oH
https://api.github.com/repos/huggingface/datasets/issues/comments/1686092295/reactions
2023-08-21T10:46:48Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1686092295
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
@lhoestq The error is
```
def _info(self) -> DatasetInfo:
        _ = self.option1  <-
        ....
AttributeError: 'BuilderConfig' object has no attribute 'option1'
```
which seems to find another unknown config.

You can try this line `datasets.load_dataset("indonesian-nlp/librivox-indonesia", split="train", data_dir='.')`, it's a multi-config dataset on HF hub and the error is the same.

My insights:
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518
if `config_kwargs` is provided here, the if branch is skipped.
2023-08-21T11:40:12Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1686169348
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kgOcE
https://api.github.com/repos/huggingface/datasets/issues/comments/1686169348/reactions
2023-08-21T11:45:15Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1686169348
https://avatars.githubusercontent.com/u/11533479?v=4
https://api.github.com/users/npuichigo/events{/privacy}
https://api.github.com/users/npuichigo/followers
https://api.github.com/users/npuichigo/following{/other_user}
https://api.github.com/users/npuichigo/gists{/gist_id}
https://github.com/npuichigo
npuichigo
MDQ6VXNlcjExNTMzNDc5
https://api.github.com/users/npuichigo/orgs
https://api.github.com/users/npuichigo/received_events
https://api.github.com/users/npuichigo/repos
https://api.github.com/users/npuichigo/starred{/owner}{/repo}
https://api.github.com/users/npuichigo/subscriptions
User
https://api.github.com/users/npuichigo
public
MEMBER
I see, you just have to set this class attribute to your builder class :)

```python
BUILDER_CONFIG_CLASS = MyDatasetConfig
```
2023-08-21T15:06:24Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1686508167
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5khhKH
https://api.github.com/repos/huggingface/datasets/issues/comments/1686508167/reactions
2023-08-21T15:06:24Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1686508167
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
So what does this attribute do? In most cases it's not used and the [documents for multi-config dataset](https://huggingface.co/docs/datasets/main/en/image_dataset#multiple-configurations) never mentioned that.
2023-08-21T15:35:28Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1686561145
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5khuF5
https://api.github.com/repos/huggingface/datasets/issues/comments/1686561145/reactions
2023-08-21T15:35:28Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1686561145
https://avatars.githubusercontent.com/u/11533479?v=4
https://api.github.com/users/npuichigo/events{/privacy}
https://api.github.com/users/npuichigo/followers
https://api.github.com/users/npuichigo/following{/other_user}
https://api.github.com/users/npuichigo/gists{/gist_id}
https://github.com/npuichigo
npuichigo
MDQ6VXNlcjExNTMzNDc5
https://api.github.com/users/npuichigo/orgs
https://api.github.com/users/npuichigo/received_events
https://api.github.com/users/npuichigo/repos
https://api.github.com/users/npuichigo/starred{/owner}{/repo}
https://api.github.com/users/npuichigo/subscriptions
User
https://api.github.com/users/npuichigo
public
MEMBER
It tells which builder config class to instantiate if additional config parameters are passed to load_dataset
2023-08-21T16:06:14Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1686611507
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kh6Yz
https://api.github.com/repos/huggingface/datasets/issues/comments/1686611507/reactions
2023-08-21T16:06:14Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1686611507
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
@lhoestq maybe we can enhance the document to say something about the common attributes of `DatasetBuilder`
2023-08-22T05:16:40Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1687444559
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5klFxP
https://api.github.com/repos/huggingface/datasets/issues/comments/1687444559/reactions
2023-08-22T05:16:40Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1687444559
https://avatars.githubusercontent.com/u/11533479?v=4
https://api.github.com/users/npuichigo/events{/privacy}
https://api.github.com/users/npuichigo/followers
https://api.github.com/users/npuichigo/following{/other_user}
https://api.github.com/users/npuichigo/gists{/gist_id}
https://github.com/npuichigo
npuichigo
MDQ6VXNlcjExNTMzNDc5
https://api.github.com/users/npuichigo/orgs
https://api.github.com/users/npuichigo/received_events
https://api.github.com/users/npuichigo/repos
https://api.github.com/users/npuichigo/starred{/owner}{/repo}
https://api.github.com/users/npuichigo/subscriptions
User
https://api.github.com/users/npuichigo
public
MEMBER
Ah indeed it's missing in the docs, thanks for reporting. I'm opening a PR
2023-08-22T10:03:41Z
https://github.com/huggingface/datasets/issues/6130#issuecomment-1687886013
https://api.github.com/repos/huggingface/datasets/issues/6130
IC_kwDODunzps5kmxi9
https://api.github.com/repos/huggingface/datasets/issues/comments/1687886013/reactions
2023-08-22T10:03:41Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1687886013
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
### Describe the bug

https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522

If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.

### Steps to reproduce the bug

```python
import datasets

datasets.load_dataset('/dataset/with/multiple/config'')  # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some')  # Err
```

### Expected behavior

Default config behavior should be consistent.

### Environment info

- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3