Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Support to change distribution settings when updating datasets #5034

Closed
Tracked by #5000
jfcalvo opened this issue Jun 14, 2024 · 0 comments · Fixed by #5187
Closed
Tracked by #5000

[TASK] Support to change distribution settings when updating datasets #5034

jfcalvo opened this issue Jun 14, 2024 · 0 comments · Fixed by #5187
Assignees

Comments

@jfcalvo
Copy link
Member

jfcalvo commented Jun 14, 2024

No description provided.

frascuchon added a commit that referenced this issue Jul 19, 2024
# Description
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

This PR adds support to configure the task distribution strategy when
creating or updating datasets.

We can create datasets with specific task distribution setup
```python

task_distribution = TaskDistribution(min_submitted=4)

settings = Settings(
    fields=[TextField(name="text", title="text")],
    questions=[LabelQuestion(name="label", title="text", labels=["positive", "negative"])],
    distribution=task_distribution,
)
dataset = Dataset(dataset_name, settings=settings).create()
```

or update an existing dataset (without any user response)
```python
dataset = client.datasets(...)

dataset.settings.distribution.min_submitted = 100
# or 
dataset.distribution.min_submitted = 100
# or 
dataset.distribution = TaskDistribution(min_submitted=100)
dataset.update()
```


Closes #5033
Closes #5034


Refs: #5246


**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- New feature (non-breaking change which adds functionality)
- Improvement (change adding some improvement to an existing
functionality)

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- I added relevant documentation
- I followed the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------

Co-authored-by: José Francisco Calvo <jose@argilla.io>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Damián Pumar <damianpumar@gmail.com>
Co-authored-by: José Francisco Calvo <josefranciscocalvo@gmail.com>
Co-authored-by: Leire <leire@argilla.io>
Co-authored-by: David Berenstein <david.m.berenstein@gmail.com>
Co-authored-by: Natalia Elvira <126158523+nataliaElv@users.noreply.github.com>
Co-authored-by: Sara Han <127759186+sdiazlor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants