Remove MegatronTokenizerWriter from writer/__init__.py - #1507
Conversation
Greptile SummaryThis PR removes Key changes:
Notable observation: This is a breaking change for any external users who were importing Confidence Score: 4/5
Important Files Changed
Flowchartflowchart TD
A["User imports MegatronTokenizerWriter"] --> B{Before PR}
A --> C{After PR}
B --> D["from nemo_curator.stages.text.io.writer import MegatronTokenizerWriter"]
D --> E["writer/__init__.py"]
E --> F["megatron_tokenizer.py\n(imports transformers ~150MB)"]
C --> G["from nemo_curator.stages.text.io.writer.megatron_tokenizer import MegatronTokenizerWriter"]
G --> F
H["User imports JsonlWriter or ParquetWriter"] --> I["from nemo_curator.stages.text.io.writer import JsonlWriter"]
I --> J["writer/__init__.py (Before PR)\nLoaded transformers transitively"]
I --> K["writer/__init__.py (After PR)\nNo transformers import"]
style J fill:#f88,stroke:#c33
style K fill:#8f8,stroke:#3a3
Last reviewed commit: 7b4fcff |
sarahyurick
left a comment
There was a problem hiding this comment.
Thank you @ArivunidhiA !
|
/ok to test 9a75edb |
Additional Comments (1)
The from nemo_curator.stages.text.io.writer import MegatronTokenizerWriterwill receive an - **MegatronTokenizerWriter Import Path Changed**: `MegatronTokenizerWriter` is no longer re-exported from `nemo_curator.stages.text.io.writer`. Use the direct import instead:
```python
from nemo_curator.stages.text.io.writer.megatron_tokenizer import MegatronTokenizerWriter |
) (NVIDIA-NeMo#1507) Signed-off-by: Arivunidhi A <arivunidhi.a@gmail.com> Co-authored-by: Arivunidhi A <arivunidhi.a@gmail.com> Co-authored-by: Sarah Yurick <53962159+sarahyurick@users.noreply.github.com> Signed-off-by: Omkar Kabde <omkarkabde@gmail.com>
) (NVIDIA-NeMo#1507) Signed-off-by: Arivunidhi A <arivunidhi.a@gmail.com> Co-authored-by: Arivunidhi A <arivunidhi.a@gmail.com> Co-authored-by: Sarah Yurick <53962159+sarahyurick@users.noreply.github.com> Signed-off-by: Vibhu Jawa <vjawa@nvidia.com>
Description
Closes #1418
Remove
MegatronTokenizerWriterre-export fromwriter/__init__.pyto avoid transitively importingtransformers(~150 MB peak memory) for users who only needJsonlWriterorParquetWriter.Updated internal references in tests and tutorials to use the direct import path.
Usage
Checklist