-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add .gitignore * sentence transformers is optional * add npids as dependency * add gha * WIP - none of these tests pass * add error detection for common misuse * add memory index testing * not sure why overwrite is needed * bump action versions * update tests to use FlexIndex * test_flexindex * test_flexindex * test_models * more test cases * more test cases in test_models * more test cases in test_models added default transformations to FlexIndex * removed expensive (an so far unused) GA dependencies * lazy faiss dependency * more tests * subtests in pytest * fix empty * update model cache key * fixing some broken gha tests * more tests, fixed bug with torch_retriever, fixed rank indexing * fix dependency cache * more tests * scann test * better np_vec_loader test cases * fix indentation in scann_retr.py * fix gta dependency caching * optional dependency package assertions * fix faiss_retr.py indentation * support for ivf when cuda not available * more tests, correct rank index, etc. * no more dependency caching; doesn't seem to work properly * better re-ranking test case * test_torch_vecs * make test skip conditions consistent --------- Co-authored-by: Sean MacAvaney <[email protected]>
- Loading branch information
1 parent
53e965a
commit 4813f1e
Showing
21 changed files
with
770 additions
and
162 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Test Python package | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
strategy: | ||
matrix: | ||
python: [3.8] | ||
java: [13] | ||
os: ['ubuntu-latest'] # | ||
architecture: ['x64'] | ||
terrier: ['snapshot'] #'5.3', '5.4-SNAPSHOT', | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
architecture: ${{ matrix.architecture }} | ||
distribution: 'zulu' | ||
|
||
- name: Setup conda | ||
uses: s-weigand/setup-conda@v1 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
conda-channels: anaconda, conda-forge | ||
activate-conda: true | ||
|
||
# follows https://medium.com/ai2-blog/python-caching-in-github-actions-e9452698e98d | ||
- name: Loading Torch models from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: /home/runner/.cache/ | ||
key: model-cache | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pip install --upgrade --upgrade-strategy eager -r requirements.txt -r requirements-dev.txt | ||
conda install -c pytorch faiss-cpu=1.7.4 mkl=2021 blas=1.0=mkl | ||
- name: All unit tests | ||
env: | ||
TERRIER_VERSION: ${{ matrix.terrier }} | ||
run: | | ||
pytest -s |
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,131 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
.vscode/ | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ |
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
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
Oops, something went wrong.