Skip to content

Commit

Permalink
make it a package + cleanup files
Browse files Browse the repository at this point in the history
  • Loading branch information
lauritowal committed Feb 2, 2023
1 parent 47df4b0 commit 8fd77eb
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 9 deletions.
44 changes: 44 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
MIT License

Copyright (c) 2023 EleutherAI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## License for original codebase
MIT License

Copyright (c) 2023 Collin Burns

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions elk/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# run in background
nohup python -mu elk.generation_main --model deberta-v2-xxlarge-mnli --datasets imdb --prefix normal --model_device cuda --num_data 1000 &
ps -ax | grep generation_main
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions elk/train_evaluate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# python -m elk.train --model deberta-v2-xxlarge-mnli --prefix normal --dataset imdb --num_data 1000
python -m elk.train --model deberta-v2-xxlarge-mnli --prefix normal --dataset boolq --num_data 1000
python -m elk.evaluate --model deberta-v2-xxlarge-mnli --prefix normal --dataset boolq --num_data 1000
5 changes: 0 additions & 5 deletions generate.sh

This file was deleted.

35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "elk"
description = "Keeping language models honest by directly eliciting knowledge encoded in their activations"
readme = "README.md"
requires-python = ">=3.9"
keywords = ["nlp", "interpretability", "language-models", "explainable-ai"]
license = {text = "MIT License"}
dependencies = [
"datasets==2.8.0",
"numpy==1.23.5",
"pandas==1.5.1",
"transformers==4.25.1",
"promptsource==0.2.3",
"torch",
"sentencepiece==0.1.97",
"protobuf==3.20.*",
"scikit-learn==1.2.0",
"umap-learn==0.5.3",
"matplotlib==3.6.3",
"tqdm==4.64.1"
]
version = "0.0.1"

[project.optional-dependencies]
dev = [
"pre-commit",
"pytest",
]

[tool.setuptools]
packages = ["elk"]
Empty file added setup.cfg
Empty file.
4 changes: 0 additions & 4 deletions train_evaluate.sh

This file was deleted.

0 comments on commit 8fd77eb

Please sign in to comment.