Skip to content

Support configurable extra fields for LazyNeMoTarredIterator#9548

Merged
pzelasko merged 4 commits intomainfrom
extra-field-support-nemo-tar
Jul 19, 2024
Merged

Support configurable extra fields for LazyNeMoTarredIterator#9548
pzelasko merged 4 commits intomainfrom
extra-field-support-nemo-tar

Conversation

@pzelasko
Copy link
Collaborator

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
@pzelasko pzelasko marked this pull request as ready for review June 28, 2024 20:18
try:
if isinstance(getattr(cfg, attr), fdl.Config):
_artifact_transform(getattr(cfg, attr), output_path=output_path)
except ValueError:

Check notice

Code scanning / CodeQL

Empty except

'except' clause does nothing but pass and there is no explanatory comment.

track_io(SentencePieceTokenizer, artifacts=[FileArtifact("model_path")])
__all__.append("SentencePieceTokenizer")
except ImportError:

Check notice

Code scanning / CodeQL

Empty except

'except' clause does nothing but pass and there is no explanatory comment.
],
)
__all__.append("AutoTokenizer")
except ImportError:

Check notice

Code scanning / CodeQL

Empty except

'except' clause does nothing but pass and there is no explanatory comment.
@@ -1,4 +1,4 @@
from typing import Callable, List, Optional
from typing import Any, Callable, List, Mapping, Optional

Check notice

Code scanning / CodeQL

Unused import

Import of 'Any' is not used. Import of 'Mapping' is not used.
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
seed = resolve_seed(self.shard_seed)
random.Random(seed).shuffle(shard_ids)

# Propagate the random seed
Copy link
Collaborator

Choose a reason for hiding this comment

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

just for reproducibility or is there any other reason?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reproducibility/consistent RNG behavior across all dataloading modules.


>>> cuts = lhotse.CutSet(LazyNeMoIterator(
... "nemo_manifests/train.json",
... extra_fields=[{"type": "text_iter", "name": "question", "path": "questions.txt"}],
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there value in allowing to path to be a list of questions also ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure I understood your comment - do you mean "path": ["questions1.txt", "questions2.txt"]? what would be the expected behavior?

@github-actions
Copy link
Contributor

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jul 16, 2024
Copy link
Collaborator

@zhehuaichen zhehuaichen left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@pzelasko pzelasko merged commit e244cfd into main Jul 19, 2024
@pzelasko pzelasko deleted the extra-field-support-nemo-tar branch July 19, 2024 01:34
ertkonuk pushed a commit that referenced this pull request Jul 19, 2024
* Support configurable extra fields for LazyNeMoTarredIterator

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Add tests and fixes

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Documentation, more tests

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

---------

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Tugrul Konuk <ertkonuk@gmail.com>
tonyjie pushed a commit to tonyjie/NeMo that referenced this pull request Jul 24, 2024
…NeMo#9548)

* Support configurable extra fields for LazyNeMoTarredIterator

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Add tests and fixes

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Documentation, more tests

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

---------

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
akoumpa pushed a commit that referenced this pull request Jul 25, 2024
* Support configurable extra fields for LazyNeMoTarredIterator

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Add tests and fixes

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Documentation, more tests

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

---------

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
monica-sekoyan pushed a commit that referenced this pull request Oct 14, 2024
* Support configurable extra fields for LazyNeMoTarredIterator

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Add tests and fixes

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Documentation, more tests

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

---------

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
hainan-xv pushed a commit to hainan-xv/NeMo that referenced this pull request Nov 5, 2024
…NeMo#9548)

* Support configurable extra fields for LazyNeMoTarredIterator

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Add tests and fixes

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Documentation, more tests

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

---------

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Hainan Xu <hainanx@nvidia.com>
XuesongYang pushed a commit to paarthneekhara/NeMo that referenced this pull request Jan 18, 2025
…NeMo#9548)

* Support configurable extra fields for LazyNeMoTarredIterator

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Add tests and fixes

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* Documentation, more tests

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

---------

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments