Skip to content

Commit 7e3c6cd

Browse files
committed
Update setup.py
1 parent 78dede1 commit 7e3c6cd

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ To download a pre-trained model, call `download` function:
8888
```python
8989
>>> from anago.utils import download
9090

91-
>>> url = 'https://storage.googleapis.com/chakki/datasets/public/ner/models_en.zip'
91+
>>> url = 'https://storage.googleapis.com/chakki/datasets/public/ner/model_en.zip'
9292
>>> download(url)
9393
'Downloading...'
9494
'Complete!'

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
sys.exit()
2424

2525
required = [
26-
'Keras>=2.1.1', 'h5py>=2.7.1', 'scikit-learn>=0.19.1', 'numpy>=1.13.3', 'tensorflow>=1.4.0',
26+
'Keras>=2.1.6', 'h5py>=2.7.1', 'scikit-learn>=0.19.1', 'numpy>=1.14.3', 'tensorflow>=1.8.0', 'requests>=2.18.4'
2727
]
2828

2929
setup(
3030
name=NAME,
31-
version='1.0.1',
31+
version='1.0.2',
3232
description=DESCRIPTION,
3333
long_description=long_description,
3434
author=AUTHOR,

tests/test_utils.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import unittest
33

4-
from anago.utils import load_data_and_labels, batch_iter, Vocabulary
4+
from anago.utils import load_data_and_labels, batch_iter, Vocabulary, download
55
from anago.preprocessing import IndexTransformer
66

77

@@ -27,6 +27,18 @@ def test_batch_iter(self):
2727
y_gen.extend(y1)
2828
self.assertEqual(len(y_gen), len(y))
2929

30+
def test_download(self):
31+
save_dir = os.path.join(os.path.dirname(__file__), 'models')
32+
url = 'https://storage.googleapis.com/chakki/datasets/public/ner/model_en.zip'
33+
download(url, save_dir)
34+
35+
weights_file = os.path.join(save_dir, 'weights.h5')
36+
params_file = os.path.join(save_dir, 'params.json')
37+
preprocessor_file = os.path.join(save_dir, 'preprocessor.pickle')
38+
self.assertTrue(os.path.exists(weights_file))
39+
self.assertTrue(os.path.exists(params_file))
40+
self.assertTrue(os.path.exists(preprocessor_file))
41+
3042

3143
class TestVocabulary(unittest.TestCase):
3244

0 commit comments

Comments
 (0)