Skip to main content

Officially supported models for the AllenNLP framework

Project description


Officially supported AllenNLP models.


Build PyPI License Codecov


❗️ To file an issue, please open a ticket on allenai/allennlp and tag it with "Models". ❗️

Installing

From PyPI

allennlp-models is available on PyPI. To install with pip, just run

pip install --pre allennlp-models

Note that the allennlp-models package is tied to the allennlp core package. Therefore when you install the models package you will get the corresponding version of allennlp (if you haven't already installed allennlp). For example,

pip install allennlp-models==1.0.0rc3
pip freeze | grep allennlp
# > allennlp==1.0.0rc3
# > allennlp-models==1.0.0rc3

From source

If you intend to install the models package from source, then you probably also want to install allennlp from source. Once you have allennlp installed, run the following within the same Python environment:

git clone https://github.com/allenai/allennlp-models.git
cd allennlp-models
ALLENNLP_VERSION_OVERRIDE='allennlp' pip install -e .
pip install -r dev-requirements.txt

The ALLENNLP_VERSION_OVERRIDE environment variable ensures that the allennlp dependency is unpinned so that your local install of allennlp will be sufficient. If, however, you haven't installed allennlp yet and don't want to manage a local install, just omit this environment variable and allennlp will be installed from the master branch on GitHub.

Both allennlp and allennlp-models are developed and tested side-by-side, so they should be kept up-to-date with each other. If you look at the GitHub Actions workflow for allennlp-models, it's always tested against the master branch of allennlp. Similarly, allennlp is always tested against the master branch of allennlp-models.

Using Docker

Docker provides a virtual machine with everything set up to run AllenNLP-- whether you will leverage a GPU or just run on a CPU. Docker provides more isolation and consistency, and also makes it easy to distribute your environment to a compute cluster.

Once you have installed Docker you can either use a prebuilt image from a release or build an image locally with any version of allennlp and allennlp-models.

To build an image locally from a specific release, run

docker build \
    --build-arg ALLENNLP_VERSION=1.0.0rc3 \
    -t allennlp/models - < Dockerfile.release

Just replace "1.0.0rc3" with the desired version.

Alternatively, you can build against specific commits of allennlp and allennlp-models with

docker build \
    --build-arg ALLENNLP_COMMIT=e3d72fcb1664caf9554ef4e611191c33a7a5cbbd \
    --build-arg ALLENNLP_MODELS_COMMIT=54a5df89da64d8d3869e746bc6dab940552dbfc4 \
    -t allennlp/models - < Dockerfile.commit

Just change the ALLENNLP_COMMIT and ALLENNLP_MODELS_COMMIT build args to the desired commit SHAs.

Now run the following command to get an environment that will run on either the cpu or gpu.

mkdir -p $HOME/.allennlp/
docker run --rm -v $HOME/.allennlp:/root/.allennlp allennlp/models

If you have GPUs available, you can install the nvidia-docker runtime and then add the flag --gpus all right before --rm.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

allennlp_models-1.1.0rc3.tar.gz (201.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

allennlp_models-1.1.0rc3-py3-none-any.whl (321.1 kB view details)

Uploaded Python 3

File details

Details for the file allennlp_models-1.1.0rc3.tar.gz.

File metadata

  • Download URL: allennlp_models-1.1.0rc3.tar.gz
  • Upload date:
  • Size: 201.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for allennlp_models-1.1.0rc3.tar.gz
Algorithm Hash digest
SHA256 30276890cf7016f5d3f33d682ba8b91d1224414ad7b305eb01269aa980500d21
MD5 da1288792a99eea1ee1d3b115fa4eaf9
BLAKE2b-256 adb6c47864107553739e1a1edf7dabda9fa49a5adc46f8d8824cc87e9242cdb3

See more details on using hashes here.

File details

Details for the file allennlp_models-1.1.0rc3-py3-none-any.whl.

File metadata

  • Download URL: allennlp_models-1.1.0rc3-py3-none-any.whl
  • Upload date:
  • Size: 321.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for allennlp_models-1.1.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 d774b63cf3713c7324b65ea18d4a14740c46a2f67b83476790b1ed39760ffb75
MD5 744512296b038b680c85ce09f9f2808a
BLAKE2b-256 3599ed9a703bad6595194e0455ec6678c8afb9519fdb15150feb964550710a09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page