8000 Update README.md by schmmd · Pull Request #1718 · allenai/allennlp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Update README.md #1718

Merged
merged 3 commits into from
Sep 6, 2018
Merged
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
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ environment you want to use, you can skip to the 'installing via pip' section.

Installing the library and dependencies is simple using `pip`.

```bash
pip install allennlp
```
```bash
pip install allennlp
```

That's it! You're now ready to build and train AllenNLP models.
AllenNLP installs a script when you install the python package, meaning you can run allennlp commands just by typing `allennlp` into a terminal.

You can now test your installation with `./scripts/verify.py`.

_`pip` currently installs Pytorch for CUDA 8 only (or no GPU). If you require a newer version,
please visit http://pytorch.org/ and install the relevant pytorch binary._

Expand All @@ -57,12 +59,13 @@ isolation and consistency, and also makes it easy to distribute your
environment to a compute cluster.

Once you have [installed Docker](https://docs.docker.com/engine/installation/)
just run `docker run -it -p 8000:8000 --rm allennlp/allennlp:v0.6.1` to get an environment that will run on either the cpu or gpu.
just run the following command to get an environment that will run on either the cpu or gpu.

You can now test your installation with `./scripts/verify.py`.
```bash
docker run -it -p 8000:8000 --rm allennlp/allennlp:v0.6.1`
```

Our Docker image contains the AllenNLP source rather than a `pip` installation. Consequently, the `allennlp` commandline tool is not
installed and you will have to use `./allennlp/run.py` instead.
You can now test your installation with `./scripts/verify.py`.

### Installing from source

Expand Down Expand Up @@ -95,18 +98,19 @@ You can test your installation with `./scripts/verify.py`.
## Running AllenNLP

Once you've installed AllenNLP, you can run the command-line interface either
with the `allennlp` command (if you installed via `pip`) or `python -m
allennlp.run` (if you installed via source).
with the `allennlp` command (if you installed via `pip`) or `bin/allennlp` (if you installed via source).

```bash
$ allennlp
Run AllenNLP

optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit

Commands:


configure Generate configuration stubs.
train Train a model
evaluate Evaluate the specified model + dataset
predict Use a trained model to make predictions.
Expand Down Expand Up @@ -136,7 +140,7 @@ following principles:

AllenNLP includes reference implementations of high quality models for Semantic
Role Labelling, Question and Answering (BiDAF), Entailment (decomposable
attention), and more.
attention), and more (see http://www.allennlp.org/models).

AllenNLP is built and maintained by the Allen Institute for Artificial
Intelligence, in close collaboration with researchers at the University of
Expand Down Expand Up @@ -181,21 +185,20 @@ state of the art models with high quality engineering.

## Docker images

AllenNLP releases Docker images to Docker Cloud for each release. For information on how to run these releases, see
[Installing using Docker](#installing-using-docker).
AllenNLP releases Docker images to [Docker Hub](https://hub.docker.com/r/allennlp/) for each release. For information on how to run these releases, see [Installing using Docker](#installing-using-docker).

### Building a Docker image

For various reasons you may need to create your own AllenNLP Docker image.
The same image can be used either with a CPU or a GPU.

First, follow the instructions above for setting up a development environment.
First, you need to [install Docker](https://www.docker.com/get-started).
Then run the following command
(it will take some time, as it completely builds the
environment needed to run AllenNLP.)

```bash
docker build --tag allennlp/allennlp .
docker build -f Dockerfile.pip --tag allennlp/allennlp:latest .
```

You should now be able to see this image listed by running `docker images allennlp`.
Expand All @@ -207,8 +210,7 @@ allennlp/allennlp latest b66aee6cb593 5 minutes a

### Running the Docker image

You can run the image with `docker run --rm -it allennlp/allennlp`. The `--rm` flag cleans up the image on exit and the
`-it` flags make the session interactive so you can use the bash shell the Docker image starts.
You can run the image with `docker run --rm -it allennlp/allennlp:latest`. The `--rm` flag cleans up the image on exit and the `-it` flags make the session interactive so you can use the bash shell the Docker image starts.

You can test your installation by running `./scripts/verify.py`.

Expand Down
0