Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
chmod +x install.sh
pip install -e .
./install.sh
pip install flake8 pytest
- name: Test with pytest
run: |
Expand Down
18 changes: 2 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,7 @@ A comprehensive toolkit for applying active learning techniques to natural langu

## 🔧 Installation

1. Clone the repository:
```bash
git clone https://github.com/Aktsvigun/atgen.git
cd atgen
```

2. Run the installation script:
```bash
bash install.sh
```

This will install:
- All required Python packages
- External metrics (submodlib, AlignScore)
- Required NLP resources
`pip install atgen`

## 🚀 Usage

Expand Down Expand Up @@ -115,4 +101,4 @@ If you use this toolkit in your research, please cite:
url = {https://github.com/Aktsvigun/atgen},
year = {2025},
}
```
```
37 changes: 0 additions & 37 deletions install.sh

This file was deleted.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ build-backend = "setuptools.build_meta"

[project]
name = "atgen"
version = "0.0.0"
version = "0.1.0"
authors = [
{ name = "List of contributors: https://github.com/Aktsvigun/atgen/graphs/contributors", email = "artemshelmanov@gmail.com" },
]
description = "Toolkit for Active Learning in Generative Tasks"
readme = "README.md"

keywords = ["NLP", "deep learning", "transformer", "pytorch", "peft", "inference", "active learning"]
license = {file = "LICENSE.md"}
license-files = ["LICENSE.md"]

requires-python = ">=3.10"
dynamic = ["dependencies"]
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
alignscore-SpeedOfMagic
accelerate==1.5.2
anthropic==0.49.0
benepar==0.2.0
Expand Down
2 changes: 1 addition & 1 deletion src/atgen/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# Going up 3 levels from metrics.py: src/atgen/metrics -> repository root
os.path.join(
Path(__file__).parents[3],
"external_metrics/AlignScore/model/AlignScore-base.ckpt",
"cache/AlignScore-base.ckpt",
),
)

Expand Down
5 changes: 5 additions & 0 deletions src/atgen/run_scripts/run_active_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def run_active_learning(config, workdir: Union[str, Path]):
maybe_get_few_shot_examples,
get_output_column_name_for_phase,
)
from atgen.utils.installers import install_spacy, install_nltk
from atgen.utils.load_model_tokenizer import load_model_tokenizer
from atgen.utils.prepare_model_for_training import prepare_model_for_training
from atgen.utils.training_utils import get_trainer
Expand All @@ -50,6 +51,10 @@ def run_active_learning(config, workdir: Union[str, Path]):
check_performance_against_requirements,
)

# TODO Figure out how to stop downloading it every time
install_spacy()
install_nltk()

seed = config.seed
cache_dir = config.cache_dir
input_column_name = config.data.input_column_name
Expand Down
10 changes: 10 additions & 0 deletions src/atgen/utils/installers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import subprocess


def install_spacy():
subprocess.run("python -m spacy download en_core_web_sm", shell=True)

def install_nltk():
import nltk
nltk.download('punkt')
nltk.download('punkt_tab')