-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from allenai/soldni/cli
CLI for dolma
- Loading branch information
Showing
60 changed files
with
2,210 additions
and
702 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
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 |
---|---|---|
|
@@ -39,6 +39,10 @@ authors: | |
family-names: Groeneveld | ||
email: [email protected] | ||
affiliation: Allen Institute for AI | ||
- given-names: Dustin | ||
family-names: Schwenk | ||
email: [email protected] | ||
affiliation: Allen Institute for AI | ||
- given-names: Ian | ||
family-names: Magnusson | ||
email: [email protected] | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,57 @@ | ||
UNAME := $(shell uname) | ||
|
||
ifeq ($(UNAME), Darwin) | ||
OS_MESSAGE := "MacOS detected" | ||
CMAKE_SETUP := "which cmake || brew install cmake" | ||
PROTOBUF_SETUP := "which protoc || brew install protobuf" | ||
OPENSSL_SETUP := "which openssl || brew install openssl" | ||
else ifeq ($(UNAME), Linux) | ||
OS_MESSAGE := "Linux detected" | ||
CMAKE_SETUP := "which cmake || sudo apt-get install --yes build-essential cmake" | ||
PROTOBUF_SETUP := "which protoc || sudo apt-get install --yes protobuf-compiler" | ||
OPENSSL_SETUP := "which openssl || sudo apt-get install --yes libssl-dev" | ||
else | ||
OS_MESSAGE := "Unsupported OS; please install rust, cmake, protobuf, and openssl manually" | ||
CMAKE_SETUP := "" | ||
PROTOBUF_SETUP := "" | ||
OPENSSL_SETUP := "" | ||
endif | ||
|
||
setup: | ||
@echo "${OS_MESSAGE}: installing..." | ||
$(shell "${CMAKE_SETUP}") | ||
$(shell "${PROTOBUF_SETUP}") | ||
$(shell "${OPENSSL_SETUP}") | ||
which cargo || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
which maturin || pip install maturin | ||
|
||
release: | ||
maturin build | ||
|
||
test: setup develop setup-test test-python test-rust clean-test | ||
|
||
test-python: | ||
pytest -vs tests/python | ||
|
||
test-rust: | ||
cargo test -- --nocapture | ||
|
||
clean-test: | ||
rm -rf tests/work/* | ||
aws s3 rm --recursive s3://ai2-llm/pretraining-data/tests/mixer/ | ||
|
||
setup-test: | ||
aws s3 cp tests/data/documents.json.gz s3://ai2-llm/pretraining-data/tests/mixer/inputs/v0/documents/head/0000.json.gz | ||
aws s3 cp tests/data/pii-attributes.json.gz s3://ai2-llm/pretraining-data/tests/mixer/inputs/v0/attributes/pii/head/0000.json.gz | ||
aws s3 cp tests/data/toxicity-attributes.json.gz s3://ai2-llm/pretraining-data/tests/mixer/inputs/v0/attributes/toxicity/head/0000.json.gz | ||
aws s3 cp tests/data/sample-attributes.json.gz s3://ai2-llm/pretraining-data/tests/mixer/inputs/v0/attributes/sample/head/0000.json.gz | ||
aws s3 cp tests/data/duplicate-paragraphs.json.gz s3://ai2-llm/pretraining-data/tests/mixer/inputs/v0/attributes/duplicate_paragraphs/head/0000.json.gz | ||
aws s3 sync tests/data/expected s3://ai2-llm/pretraining-data/tests/mixer/expected --exclude ".*" --exclude "*/.*" | ||
|
||
develop: | ||
maturin develop --extras=dev | ||
|
||
style: | ||
rustfmt --edition 2021 src/*.rs | ||
autopep8 --in-place --recursive python/ && isort python/ && black python/ | ||
autopep8 --in-place --recursive tests/python/ && isort tests/python/ && black tests/python/ |
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 |
---|---|---|
|
@@ -11,7 +11,6 @@ dependencies = [ | |
"boto3", | ||
"cached-path==1.3.4", | ||
"msgspec>=0.14.2", | ||
"smashed[remote]>=0.20.0", | ||
"presidio_analyzer==2.2.32", | ||
"pycld2==0.41", | ||
# "pycld3==0.22", | ||
|
@@ -23,12 +22,14 @@ dependencies = [ | |
"pyyaml", | ||
"blingfire==0.1.8", | ||
"detect-secrets==1.4.0", | ||
"termcolor==2.3.0", | ||
"rich>=10.12.0", | ||
"smart-open>=6.3.0", | ||
"nltk==3.8.1" | ||
"nltk==3.8.1", | ||
"fsspec>=2021.10.0", | ||
"s3fs>=2021.10.0", | ||
] | ||
classifiers = [ | ||
"Development Status :: 3 - Veta", | ||
"Development Status :: 3 - Alpha", | ||
"Typing :: Typed", | ||
"Programming Language :: Rust", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
|
@@ -67,6 +68,10 @@ email = "[email protected]" | |
name = "Dirk Groeneveld" | ||
email = "[email protected]" | ||
|
||
[[project.authors]] | ||
name = "Dustin Schwenk" | ||
email = "[email protected]" | ||
|
||
[[project.authors]] | ||
name = "Ian Magnusson" | ||
email = "[email protected]" | ||
|
@@ -98,6 +103,7 @@ dev = [ | |
"ipdb>=0.13.0", | ||
"flake8-pyi>=22.8.1", | ||
"Flake8-pyproject>=1.1.0", | ||
"awscli>=1.16.0", | ||
] | ||
[build-system] | ||
requires = [ | ||
|
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.