Skip to content

Commit

Permalink
Release 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatovFedor authored Dec 27, 2023
2 parents 168e979 + 926f7a7 commit 1ed6ad4
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 74 deletions.
13 changes: 8 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# .readthedocs.yml
version: 2

build:
image: latest

os: "ubuntu-20.04"
tools:
python: "3.10"
formats: []

python:
pip_install: true
version: 3.6
extra_requirements:
install:
- method: pip
path: .
extra_requirements:
- docs
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ Please leave us [your feedback](https://forms.gle/i64fowQmiVhMMC7f9) on how we c

## Installation

0. We support `Linux` platform, `Python 3.6`, `3.7`, `3.8`, `3.9` and `3.10`
* **`Python 3.5` is not supported!**
0. DeepPavlov supports `Linux`, `Windows 10+` (through WSL/WSL2), `MacOS` (Big Sur+) platforms, `Python 3.6`, `3.7`, `3.8`, `3.9` and `3.10`.
Depending on the model used, you may need from 4 to 16 GB RAM.

1. Create and activate a virtual environment:
* `Linux`
Expand Down Expand Up @@ -99,6 +99,7 @@ By default, DeepPavlov installs models requirements from PyPI. PyTorch from PyPI
capability. To run supported DeepPavlov models on GPU you should have [CUDA](https://developer.nvidia.com/cuda-toolkit)
compatible with used GPU and [PyTorch version](deeppavlov/requirements/pytorch.txt) required by DeepPavlov models.
See [docs](https://docs.deeppavlov.ai/en/master/intro/quick_start.html#using-gpu) for details.
GPU with Pascal or newer architecture and 4+ GB VRAM is recommended.

### Command line interface (CLI)

Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/_meta.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.4.0'
__version__ = '1.5.0'
__author__ = 'Neural Networks and Deep Learning lab, MIPT'
__description__ = 'An open source library for building end-to-end dialog systems and training chatbots.'
__keywords__ = ['NLP', 'NER', 'SQUAD', 'Intents', 'Chatbot']
Expand Down
4 changes: 3 additions & 1 deletion deeppavlov/core/commands/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def train_evaluate_model_from_config(config: Union[str, Path, dict],
if iterator is None:
try:
data = read_data_by_config(config)
if config.get('train', {}).get('val_every_n_epochs') and not data.get('valid'):
# TODO: check class objects, not strings
is_mtl = config['dataset_reader']['class_name'] == 'multitask_reader'
if config.get('train', {}).get('val_every_n_epochs') and not data.get('valid') and not is_mtl:
error_message = 'The value "val_every_n_epochs" is set in the config but no validation data is provided'
raise AttributeError(error_message)
except ConfigError as e:
Expand Down
18 changes: 9 additions & 9 deletions docs/features/models/NER.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@
"metadata": {},
"outputs": [],
"source": [
"!python -m deeppavlov install ner_ontonotes_bert_torch"
"!python -m deeppavlov install ner_ontonotes_bert"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`ner_ontonotes_bert_torch` is the name of the model's *config_file*. [What is a Config File?](http://docs.deeppavlov.ai/en/master/intro/configuration.html) \n",
"`ner_ontonotes_bert` is the name of the model's *config_file*. [What is a Config File?](http://docs.deeppavlov.ai/en/master/intro/configuration.html) \n",
"\n",
"Configuration file defines the model and describes its hyperparameters. To use another model, change the name of the *config_file* here and further.\n",
"The full list of NER models with their config names can be found in the [table](#3.-Models-list).\n",
Expand Down Expand Up @@ -126,7 +126,7 @@
"source": [
"from deeppavlov import build_model\n",
"\n",
"ner_model = build_model('ner_ontonotes_bert_torch', download=True, install=True)"
"ner_model = build_model('ner_ontonotes_bert', download=True, install=True)"
]
},
{
Expand Down Expand Up @@ -180,7 +180,7 @@
"metadata": {},
"outputs": [],
"source": [
"! python -m deeppavlov interact ner_ontonotes_bert_torch -d"
"! python -m deeppavlov interact ner_ontonotes_bert -d"
]
},
{
Expand All @@ -198,7 +198,7 @@
"metadata": {},
"outputs": [],
"source": [
"! python -m deeppavlov predict ner_ontonotes_bert_torch -f <file-name>"
"! python -m deeppavlov predict ner_ontonotes_bert -f <file-name>"
]
},
{
Expand All @@ -224,7 +224,7 @@
"source": [
"from deeppavlov import evaluate_model\n",
"\n",
"model = evaluate_model('ner_ontonotes_bert_torch', download=True)"
"model = evaluate_model('ner_ontonotes_bert', download=True)"
]
},
{
Expand All @@ -240,7 +240,7 @@
"metadata": {},
"outputs": [],
"source": [
"! python -m deeppavlov evaluate ner_ontonotes_bert_torch"
"! python -m deeppavlov evaluate ner_ontonotes_bert"
]
},
{
Expand Down Expand Up @@ -275,7 +275,7 @@
"from deeppavlov import train_model\n",
"from deeppavlov.core.commands.utils import parse_config\n",
"\n",
"model_config = parse_config('ner_ontonotes_bert_torch')\n",
"model_config = parse_config('ner_ontonotes_bert')\n",
"\n",
"# dataset that the model was trained on\n",
"print(model_config['dataset_reader']['data_path'])"
Expand Down Expand Up @@ -401,7 +401,7 @@
"metadata": {},
"outputs": [],
"source": [
"! python -m deeppavlov train ner_ontonotes_bert_torch"
"! python -m deeppavlov train ner_ontonotes_bert"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion docs/features/models/multitask_bert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Multi-task BERT in DeepPavlov
=============================

Multi-task BERT in DeepPavlov is an implementation of BERT training algorithm published in the paper
`Multi-Task Deep Neural Networks for Natural Language Understanding <https://arxiv.org/abs/1901.11504>`_.
`Knowledge Transfer Between Tasks and Languages in the Multi-task
Encoder-agnostic Transformer-based Models <https://www.dialog-21.ru/media/5902/karpovdpluskonovalovv002.pdf>`_.

The idea is to share BERT body between several tasks. This is necessary if a model pipe has several
components using BERT and the amount of GPU memory is limited. Each task has its own 'head' part attached to the
Expand Down
23 changes: 23 additions & 0 deletions docs/integrations/rest_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,26 @@ Here are POST request payload examples for some of the library models:
| | |  "question_raw":["What strained the relationship between Great Britain and its colonies?"]} |
+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+

REST API Usage Example
======================

To start server with ``squad_bert`` model run:

.. code:: bash
python -m deeppavlov riseapi squad_bert -id
To get response from this model on another terminal run:

.. code:: bash
curl -X POST http://0.0.0.0:5000/model -H 'Content-Type: application/json' -d '{
"context_raw": [
"All work and no play makes Jack a dull boy.",
"I used to be an adventurer like you, then I took an arrow in the knee."
],
"question_raw": [
"What makes Jack a dull boy?",
"Who I used to be?"
]
}'
52 changes: 39 additions & 13 deletions docs/intro/installation.rst
Original file line number Diff line number Diff line change
@@ -1,43 +1,69 @@
Installation
============

DeepPavlov supports **Linux**, **Windows 10+** (through WSL/WSL2), **MacOS** (Big Sur+) platforms, **Python 3.6-3.10**.
Depending on the model used, you may need from 4 to 16 GB RAM.

We support ``Linux`` platform, ``Python 3.6``, ``3.7``, ``3.8``, ``3.9`` and ``3.10``.

.. note::

* ``Python 3.5`` is not supported!
Install with pip
~~~~~~~~~~~~~~~~

You should install DeepPavlov in a `virtual environment <https://docs.python.org/3/library/venv.html>`_. If you’re
unfamiliar with Python virtual environments, take a look at this
`guide <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/>`_. A virtual
environment makes it easier to manage different projects, and avoid compatibility issues between dependencies.

#. Create a virtual environment:

.. code:: bash
python -m venv env
#. Activate the environment:
#. Activate the virtual environment on Linux (`source` could be replaced with `.`):

* Linux

.. code:: bash
.. code:: bash
source ./env/bin/activate
source env/bin/activate
#. Install the package inside this virtual environment:
#. Install DeepPavlov inside this virtual environment:

.. code:: bash
pip install deeppavlov
Install from source
~~~~~~~~~~~~~~~~~~~

Install DeepPavlov **dev** branch from source with the following command:

.. code:: bash
pip install git+http://github.com/deeppavlov/DeepPavlov@dev
This command installs the bleeding edge dev version rather than the latest release version. The dev version is useful
for staying up-to-date with the latest developments. For instance, if a bug has been fixed since the last release but
a new release hasn’t been rolled out yet. However, this means the dev version may not always be stable.

Editable install
~~~~~~~~~~~~~~~~

You will need an editable install if you want to make changes in the DeepPavlov source code that immediately take place
without requiring a new installation.

Clone the repository and install DeepPavlov with the following commands:

.. code:: bash
git clone http://github.com/deeppavlov/DeepPavlov.git
pip install -e DeepPavlov
Docker Images
-------------
~~~~~~~~~~~~~

We have built several DeepPavlov based Docker images, which include:

* DeepPavlov based Jupyter notebook Docker image;
* Docker images which serve some of our models and allow to access them
via REST API (``riseapi`` mode).
via REST API (:doc:`riseapi </integrations/rest_api>` mode).

Here is our `DockerHub repository <https://hub.docker.com/u/deeppavlov/>`_ with
images and deployment instructions.
Loading

0 comments on commit 1ed6ad4

Please sign in to comment.