The utils_nlp module of this repository needs to be installed as a python package in order to be used by the examples. Click to expand and see the details
A setup.py file is provided in order to simplify the installation of this utilities in this repo from the main directory.
To install the package, please run the command below (from directory root)
pip install -e .
Running the command tells pip to install the `utils_nlp` package from source in [development mode](https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode). This just means that any updates to `utils_nlp` source directory will immediately be reflected in the installed package without needing to reinstall; a very useful practice for a package with constant updates.
> It is also possible to install directly from Github, which is the best way to utilize the `utils_nlp` package in external projects (while still reflecting updates to the source as it's installed as an editable `'-e'` package).
> `pip install -e git+git@github.com:microsoft/nlp-recipes.git@master#egg=utils_nlp`
Either command, from above, makes `utils_nlp` available in your conda virtual environment. You can verify it was properly installed by running:
pip list
**NOTE** - The pip installation does not install any of the necessary package dependencies, it is expected that conda will be used as shown above to setup the environment for the utilities being used.
The details of the versioning info can be found at [VERSIONING.md](VERSIONING.md).
# Set up guide for (nvidia) docker
## Pre-requisites
In order to use the notebooks within a docker enviornment, you will need to have [nvidia docker drivers](https://github.com/NVIDIA/nvidia-docker) and [docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/) installed on your computer.
## Building docker image
A docker file is provided within the [docker](docker/) folder. You can create the image using
```
cd docker
docker build -f . -t nlp-recipes
```
This will create a docker image containing all the dependencies and will name it as nlp-recipies:latest
## Running the container
You can run the notebook within the container environment using
```
docker run --gpus all -p 8888:8888 nlp-recipes
```
This will map port 8888 of the local machine
## Trouble shooting
* If you have permission issues with `docker build` or `docker run`, you might need to run docker with sudo permissions.
* If you are getting 'port already in use' errors, consider mapping a different port on the local machine to port 8888 on the container e.g.
```
docker run --gpus all -p 9000:8888 nlp-recipes
```