Skip to content

Commit

Permalink
Make torch optional (#85)
Browse files Browse the repository at this point in the history
* Make torch optional

* fix tests

* Review fixes
  • Loading branch information
LouisTrezzini authored May 28, 2020
1 parent 1d59355 commit 85515b7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python:
before_install:
- sudo rm -f /etc/boto.cfg
install:
- pip install .
- pip install .[torch]
- pip install green
script:
- pip install tensorboard>=1.14 future>=0.17.1 pillow>=6.0.0 tqdm>=4.31.1 pandas>=0.24.1
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ pip install -r requirements.txt
To use Transfer NLP as a library:

```
# to install the experiment builder only
pip install transfernlp
# to install Transfer NLP with PyTorch and Transfer Learning in NLP support
pip install transfernlp[torch]
```
or
```
Expand Down
13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
name='transfer_nlp',
packages=find_packages(exclude=["*.tests", "*.tests.*",
"tests.*", "tests"]),
version='0.1.5',
version='0.1.6',
license='MIT',
description='NLP library designed for flexible research and development',
long_description=open("README.md", "r", encoding='utf-8').read(),
long_description_content_type='text/markdown',
author='Peter Martigny',
author_email='peter.martigny@gmail.com',
url='https://github.com/feedly/transfer-nlp',
download_url='https://github.com/feedly/transfer-nlp/archive/v0.1.5.tar.gz',
download_url='https://github.com/feedly/transfer-nlp/archive/v0.1.6.tar.gz',
keywords=['NLP', 'transfer learning', 'language models', 'NLU'],
install_requires=[
'numpy>=1.16.2',
'torch==1.1.0',
'pytorch-ignite>=0.2.0',
'smart_open>=1.8.1',
'pyaml>=19.4.1',
'toml>=0.10.0'
],
extras_require={
'torch': [
'torch>=1.1.0',
'pytorch-ignite>=0.2.0',
]
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
Expand Down
2 changes: 1 addition & 1 deletion tests/runner/test_experiment_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from transfer_nlp.plugins.config import register_plugin, ExperimentConfig
from transfer_nlp.plugins.reporters import ReporterABC
from transfer_nlp.plugins.trainers import TrainerABC
from transfer_nlp.plugins.trainer_abc import TrainerABC
from transfer_nlp.runner.experiment_runner import ExperimentRunner

logger = logging.getLogger(__name__)
Expand Down

0 comments on commit 85515b7

Please sign in to comment.