Skip to content

Commit

Permalink
Merge branch 'main' of github.com:EleutherAI/elk into main
Browse files Browse the repository at this point in the history
  • Loading branch information
norabelrose committed Mar 4, 2023
2 parents d781c8c + 3994ec4 commit 2645516
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 29 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/cpu_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Python
uses: actions/setup-python@v4
Expand All @@ -29,6 +31,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Python
uses: actions/setup-python@v4
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "promptsource_module"]
path = promptsource_module
url = https://github.com/NotodAI-Research/promptsource.git
23 changes: 0 additions & 23 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,3 @@ 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.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ elk extract microsoft/deberta-v2-xxlarge-mnli imdb -o my_output_dir
```

## Development
To clone the repo and its submodules
```bash
git clone --recurse-submodules https://github.com/EleutherAI/elk.git
```
If you already cloned the repo but are missing the promptsource_module submodule, run
```bash
git submodule update --init --recursive
```


Use `pip install pre-commit && pre-commit install` in the root folder before your first commit.

Expand All @@ -41,7 +50,7 @@ Use `pip install pre-commit && pre-commit install` in the root folder before you
pytest
```
### Run type checking
We use [pyright](https://github.com/microsoft/pyright), which is built into the VSCode editor. If you'd like to run it as a standalone tool, it requires a [nodejs installation.](https://nodejs.org/en/download/).
We use [pyright](https://github.com/microsoft/pyright), which is built into the VSCode editor. If you'd like to run it as a standalone tool, it requires a [nodejs installation.](https://nodejs.org/en/download/)
```bash
pyright
```
Expand Down
2 changes: 1 addition & 1 deletion elk/extraction/prompt_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dataclasses import dataclass
from datasets import DatasetDict, load_dataset
from numpy.typing import NDArray
from promptsource.templates import DatasetTemplates
from promptsource_module.promptsource.templates import DatasetTemplates
from random import Random
from simple_parsing.helpers import field, Serializable
from torch.utils.data import Dataset as TorchDataset
Expand Down
1 change: 1 addition & 0 deletions promptsource_module
Submodule promptsource_module added at 8a07ce
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ dependencies = [
"numpy>=1.20.0",
# Introduced type annotations
"prettytable>=3.5.0",
# Our fork of the repo, enabling Python > 3.9 support
"promptsource@git+https://github.com/NotodAI-Research/promptsource.git",
# This version is old, but it's needed for certain HF tokenizers to work.
"protobuf==3.20.*",
# Basically any version should work as long as it supports the user's CUDA version
Expand All @@ -36,6 +34,8 @@ dependencies = [
"tqdm>=4.0.0",
# 4.0 introduced the breaking change of using return_dict=True by default
"transformers>=4.0.0",
# required by promptsource, which doesn't specify a version
"jinja2"
]
version = "0.1"

Expand All @@ -51,11 +51,12 @@ dev = [
elk = "elk.__main__:run"

[tool.pyright]
include = ["elk*"]
reportPrivateImportUsage = false

[tool.pytest.ini_options]
markers = ["cpu: Marker for tests that do not depend on GPUs"]
testpaths = ["tests"]

[tool.setuptools]
packages = ["elk"]
[tool.setuptools.packages.find]
include = ["elk*", "promptsource_module"]

0 comments on commit 2645516

Please sign in to comment.