-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ryan Wolf <[email protected]>
- Loading branch information
Showing
150 changed files
with
7,353 additions
and
5,909 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Test Python package | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
# When this workflow is queued, automatically cancel any previous running | ||
# or pending jobs from the same branch | ||
concurrency: | ||
group: test-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_and_test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.10"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install NeMo-Curator and pytest | ||
# TODO: Remove pytest when optional test dependencies are added to setup.py | ||
|
||
# Installing wheel beforehand due to fasttext issue: | ||
# https://github.com/facebookresearch/fastText/issues/512#issuecomment-1837367666 | ||
# Explicitly install cython: https://github.com/VKCOM/YouTokenToMe/issues/94 | ||
run: | | ||
pip install wheel cython | ||
pip install --no-cache-dir --extra-index-url https://pypi.nvidia.com . | ||
pip install pytest | ||
- name: Run tests | ||
# TODO: Remove env variable when gpu dependencies are optional | ||
run: | | ||
RAPIDS_NO_INITIALIZE=1 python -m pytest -v --cpu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
default_language_version: | ||
python: python3 | ||
|
||
ci: | ||
autofix_prs: true | ||
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions' | ||
autoupdate_schedule: quarterly | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-added-large-files | ||
args: ['--maxkb=1000'] | ||
- id: check-case-conflict | ||
- id: check-yaml | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.3.0 | ||
hooks: | ||
- id: black | ||
name: Format code | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
name: Format imports | ||
exclude: docs/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
cff-version: 1.0.0 | ||
message: "If you use this software, please cite it as below." | ||
title: "NeMo-Curator: a toolkit for data curation" | ||
repository-code: https://github.com/NVIDIA/NeMo-Curator | ||
authors: | ||
- family-names: Jennings | ||
given-names: Joseph | ||
- family-names: Patwary | ||
given-names: Mostofa | ||
- family-names: Subramanian | ||
given-names: Sandeep | ||
- family-names: Prabhumoye | ||
given-names: Shrimai | ||
- family-names: Dattagupta | ||
given-names: Ayush | ||
- family-names: Jawa | ||
given-names: Vibhu | ||
- family-names: Liu | ||
given-names: Jiwei | ||
- family-names: Wolf | ||
given-names: Ryan | ||
- family-names: Yurick | ||
given-names: Sarah | ||
- family-names: Singh | ||
given-names: Varun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
download_module: nemo_curator.download.arxiv.ArxivDownloader | ||
download_params: {} | ||
iterator_module: nemo_curator.download.arxiv.ArxivIterator | ||
iterator_params: | ||
iterator_params: | ||
log_frequency: 1000 | ||
extract_module: nemo_curator.download.arxiv.ArxivExtractor | ||
extract_params: {} | ||
format: | ||
text: str | ||
id: str | ||
source_id: str | ||
source_id: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ format: | |
language: str | ||
url: str | ||
warc_id: str | ||
source_id: str | ||
source_id: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ pii_config: | |
#type: 'hash' | ||
#hash_type: 'sha256' | ||
|
||
#type: 'redact' | ||
#type: 'redact' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ format: | |
id: str | ||
url: str | ||
language: str | ||
source_id: str | ||
source_id: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--cpu", action="store_true", default=False, help="Run tests without gpu marker" | ||
) | ||
|
||
|
||
def pytest_collection_modifyitems(config, items): | ||
if config.getoption("--cpu"): | ||
skip_gpu = pytest.mark.skip(reason="Skipping GPU tests") | ||
for item in items: | ||
if "gpu" in item.keywords: | ||
item.add_marker(skip_gpu) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.