├── .gitignore ├── .pre-commit-config.yaml ├── ACKNOWLEDGEMENTS.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── configs ├── aura.yaml ├── responses.yaml └── rtp │ └── rtp_evaluation.yaml ├── pyproject.toml ├── requirements.txt ├── scripts ├── __init__.py ├── compute_responses.py ├── evaluate_toxicity.py ├── generate_with_hooks.py └── learn_aura.py ├── src ├── __init__.py ├── datasets_lib │ ├── __init__.py │ ├── collators.py │ ├── jigsaw_dataset.py │ └── responses_io.py ├── hooks │ ├── __init__.py │ ├── dampening.py │ ├── dummy.py │ ├── pooling_ops.py │ └── postprocess_and_save_hook.py ├── models │ └── model_with_hooks.py ├── parsers │ ├── __init__.py │ └── parsers.py └── utils │ ├── __init__.py │ ├── auroc.py │ └── utils.py └── tests ├── __init__.py ├── configs ├── aura_test.yaml └── responses_test.yaml ├── data ├── aura-test-max │ └── tiny-gpt2 │ │ ├── transformer.h.0.mlp.c_proj.statedict │ │ └── transformer.h.1.mlp.c_proj.statedict ├── aura-toxicity-max │ └── tiny-gpt2 │ │ ├── transformer.h.0.mlp.c_proj.statedict │ │ └── transformer.h.1.mlp.c_proj.statedict ├── damp-toxicity-max │ └── tiny-gpt2 │ │ ├── transformer.h.0.mlp.c_proj.statedict │ │ └── transformer.h.1.mlp.c_proj.statedict ├── det0-toxicity-max │ └── tiny-gpt2 │ │ ├── transformer.h.0.mlp.c_proj.statedict │ │ └── transformer.h.1.mlp.c_proj.statedict ├── jigsaw │ └── train.csv └── toxicity-responses │ └── tiny-gpt2 │ └── jigsaw │ ├── non-toxic │ ├── transformer.h.0.mlp.c_proj │ │ └── max │ │ │ └── 5d3f045341077080.pt │ └── transformer.h.1.mlp.c_proj │ │ └── max │ │ └── 5d3f045341077080.pt │ └── toxic │ ├── transformer.h.0.mlp.c_proj │ └── max │ │ └── 11a1703cf04cd84e.pt │ └── transformer.h.1.mlp.c_proj │ └── max │ └── 11a1703cf04cd84e.pt ├── test_aura.py ├── test_datasets_lib.py ├── test_model.py ├── test_responses.py └── test_responses_io.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/.gitignore -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/.pre-commit-config.yaml -------------------------------------------------------------------------------- /ACKNOWLEDGEMENTS.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/ACKNOWLEDGEMENTS.md -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/CONTRIBUTING.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/README.md -------------------------------------------------------------------------------- /configs/aura.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/configs/aura.yaml -------------------------------------------------------------------------------- /configs/responses.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/configs/responses.yaml -------------------------------------------------------------------------------- /configs/rtp/rtp_evaluation.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/configs/rtp/rtp_evaluation.yaml -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/pyproject.toml -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/requirements.txt -------------------------------------------------------------------------------- /scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/scripts/__init__.py -------------------------------------------------------------------------------- /scripts/compute_responses.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/scripts/compute_responses.py -------------------------------------------------------------------------------- /scripts/evaluate_toxicity.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/scripts/evaluate_toxicity.py -------------------------------------------------------------------------------- /scripts/generate_with_hooks.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/scripts/generate_with_hooks.py -------------------------------------------------------------------------------- /scripts/learn_aura.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/scripts/learn_aura.py -------------------------------------------------------------------------------- /src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/__init__.py -------------------------------------------------------------------------------- /src/datasets_lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/datasets_lib/__init__.py -------------------------------------------------------------------------------- /src/datasets_lib/collators.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/datasets_lib/collators.py -------------------------------------------------------------------------------- /src/datasets_lib/jigsaw_dataset.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/datasets_lib/jigsaw_dataset.py -------------------------------------------------------------------------------- /src/datasets_lib/responses_io.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/datasets_lib/responses_io.py -------------------------------------------------------------------------------- /src/hooks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/hooks/__init__.py -------------------------------------------------------------------------------- /src/hooks/dampening.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/hooks/dampening.py -------------------------------------------------------------------------------- /src/hooks/dummy.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/hooks/dummy.py -------------------------------------------------------------------------------- /src/hooks/pooling_ops.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/hooks/pooling_ops.py -------------------------------------------------------------------------------- /src/hooks/postprocess_and_save_hook.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/hooks/postprocess_and_save_hook.py -------------------------------------------------------------------------------- /src/models/model_with_hooks.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/models/model_with_hooks.py -------------------------------------------------------------------------------- /src/parsers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/parsers/__init__.py -------------------------------------------------------------------------------- /src/parsers/parsers.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/parsers/parsers.py -------------------------------------------------------------------------------- /src/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/utils/__init__.py -------------------------------------------------------------------------------- /src/utils/auroc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/utils/auroc.py -------------------------------------------------------------------------------- /src/utils/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/src/utils/utils.py -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/__init__.py -------------------------------------------------------------------------------- /tests/configs/aura_test.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/configs/aura_test.yaml -------------------------------------------------------------------------------- /tests/configs/responses_test.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/configs/responses_test.yaml -------------------------------------------------------------------------------- /tests/data/aura-test-max/tiny-gpt2/transformer.h.0.mlp.c_proj.statedict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/aura-test-max/tiny-gpt2/transformer.h.0.mlp.c_proj.statedict -------------------------------------------------------------------------------- /tests/data/aura-test-max/tiny-gpt2/transformer.h.1.mlp.c_proj.statedict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/aura-test-max/tiny-gpt2/transformer.h.1.mlp.c_proj.statedict -------------------------------------------------------------------------------- /tests/data/aura-toxicity-max/tiny-gpt2/transformer.h.0.mlp.c_proj.statedict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/aura-toxicity-max/tiny-gpt2/transformer.h.0.mlp.c_proj.statedict -------------------------------------------------------------------------------- /tests/data/aura-toxicity-max/tiny-gpt2/transformer.h.1.mlp.c_proj.statedict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/aura-toxicity-max/tiny-gpt2/transformer.h.1.mlp.c_proj.statedict -------------------------------------------------------------------------------- /tests/data/damp-toxicity-max/tiny-gpt2/transformer.h.0.mlp.c_proj.statedict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/damp-toxicity-max/tiny-gpt2/transformer.h.0.mlp.c_proj.statedict -------------------------------------------------------------------------------- /tests/data/damp-toxicity-max/tiny-gpt2/transformer.h.1.mlp.c_proj.statedict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/damp-toxicity-max/tiny-gpt2/transformer.h.1.mlp.c_proj.statedict -------------------------------------------------------------------------------- /tests/data/det0-toxicity-max/tiny-gpt2/transformer.h.0.mlp.c_proj.statedict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/det0-toxicity-max/tiny-gpt2/transformer.h.0.mlp.c_proj.statedict -------------------------------------------------------------------------------- /tests/data/det0-toxicity-max/tiny-gpt2/transformer.h.1.mlp.c_proj.statedict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/det0-toxicity-max/tiny-gpt2/transformer.h.1.mlp.c_proj.statedict -------------------------------------------------------------------------------- /tests/data/jigsaw/train.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/jigsaw/train.csv -------------------------------------------------------------------------------- /tests/data/toxicity-responses/tiny-gpt2/jigsaw/non-toxic/transformer.h.0.mlp.c_proj/max/5d3f045341077080.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/toxicity-responses/tiny-gpt2/jigsaw/non-toxic/transformer.h.0.mlp.c_proj/max/5d3f045341077080.pt -------------------------------------------------------------------------------- /tests/data/toxicity-responses/tiny-gpt2/jigsaw/non-toxic/transformer.h.1.mlp.c_proj/max/5d3f045341077080.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/toxicity-responses/tiny-gpt2/jigsaw/non-toxic/transformer.h.1.mlp.c_proj/max/5d3f045341077080.pt -------------------------------------------------------------------------------- /tests/data/toxicity-responses/tiny-gpt2/jigsaw/toxic/transformer.h.0.mlp.c_proj/max/11a1703cf04cd84e.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/toxicity-responses/tiny-gpt2/jigsaw/toxic/transformer.h.0.mlp.c_proj/max/11a1703cf04cd84e.pt -------------------------------------------------------------------------------- /tests/data/toxicity-responses/tiny-gpt2/jigsaw/toxic/transformer.h.1.mlp.c_proj/max/11a1703cf04cd84e.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/data/toxicity-responses/tiny-gpt2/jigsaw/toxic/transformer.h.1.mlp.c_proj/max/11a1703cf04cd84e.pt -------------------------------------------------------------------------------- /tests/test_aura.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/test_aura.py -------------------------------------------------------------------------------- /tests/test_datasets_lib.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/test_datasets_lib.py -------------------------------------------------------------------------------- /tests/test_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/test_model.py -------------------------------------------------------------------------------- /tests/test_responses.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/test_responses.py -------------------------------------------------------------------------------- /tests/test_responses_io.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple/ml-aura/HEAD/tests/test_responses_io.py --------------------------------------------------------------------------------