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

Add primitive list support #1906

Merged
merged 4 commits into from
Jan 25, 2023

Conversation

mvpatel2000
Copy link
Contributor

@mvpatel2000 mvpatel2000 commented Jan 24, 2023

What does this PR do?

Add support to dataspec to split batches consisting of primitive types, e.g. a list of strings as prompts.

What issue(s) does this change relate to?

CO-1686

CO-1690

@mvpatel2000 mvpatel2000 requested review from dakinggg, A-Jacobson and eracah and removed request for dakinggg January 24, 2023 23:49
@dakinggg
Copy link
Contributor

while you're here, can you also add a test (and support if necessary) for having a single string in the batch?
e.g.

{'input_ids': <tensor with batch dimension>, 'labels': <tensor with batch dimension>, 'metadata': <single string>}

was on my list to check if that errors or not/add support

Copy link
Contributor

@dakinggg dakinggg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

tests/test_split_batch.py Show resolved Hide resolved
@mvpatel2000 mvpatel2000 requested a review from dakinggg January 25, 2023 00:13
Copy link
Contributor

@dakinggg dakinggg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@eracah eracah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just had a couple nits 😉

composer/core/data_spec.py Show resolved Hide resolved
composer/core/data_spec.py Show resolved Hide resolved
composer/core/data_spec.py Show resolved Hide resolved
@eracah
Copy link
Contributor

eracah commented Jan 25, 2023

Looks good. Just had a couple nits 😉

I will defiNITely approve the PR once those are fixed

@mvpatel2000 mvpatel2000 merged commit ab519ff into mosaicml:dev Jan 25, 2023
@mvpatel2000 mvpatel2000 deleted the mvpatel2000/primitive-list branch January 25, 2023 02:41
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 this pull request may close these issues.

3 participants