File tree Expand file tree Collapse file tree 6 files changed +107
-4
lines changed
Expand file tree Collapse file tree 6 files changed +107
-4
lines changed Original file line number Diff line number Diff line change 1+ version : 2
2+ jobs :
3+ build :
4+ docker :
5+ - image : circleci/python:3.6.1
6+
7+ working_directory : ~/repo
8+
9+ steps :
10+ - checkout
11+
12+ - restore_cache :
13+ keys :
14+ - v1-dependencies-{{ checksum "requirements.txt" }}
15+ - v1-dependencies-
16+
17+ - run :
18+ name : install dependencies
19+ command : |
20+ python3 -m venv venv
21+ . venv/bin/activate
22+ pip install -r requirements.txt
23+ - save_cache :
24+ paths :
25+ - ./venv
26+ key : v1-dependencies-{{ checksum "requirements.txt" }}
27+
28+ - run :
29+ name : run tests
30+ command : |
31+ . venv/bin/activate
32+ python -m unittest test.py
33+ - store_artifacts :
34+ path : test-reports
35+ destination : test-reports
36+
37+ deploy :
38+ docker :
39+ - image : circleci/python:3.6.1
40+
41+ working_directory : ~/repo
42+
43+ steps :
44+ - checkout
45+
46+ - restore_cache :
47+ key : v1-dependency-cache-{{ checksum "setup.py" }}-{{ checksum "Makefile" }}
48+
49+ - run :
50+ name : verify git tag vs. version
51+ command : |
52+ python3 -m venv venv
53+ . venv/bin/activate
54+ python setup.py verify
55+ pip install twine
56+ - save_cache :
57+ key : v1-dependency-cache-{{ checksum "setup.py" }}-{{ checksum "Makefile" }}
58+ paths :
59+ - " venv"
60+
61+ # Deploying to PyPI
62+ # for pip install kor2vec
63+ - run :
64+ name : init .pypirc
65+ command : |
66+ echo -e "[pypi]" >> ~/.pypirc
67+ echo -e "username = codertimo" >> ~/.pypirc
68+ echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
69+ - run :
70+ name : create packages
71+ command : |
72+ make package
73+ - run :
74+ name : upload to pypi
75+ command : |
76+ . venv/bin/activate
77+ twine upload dist/*
78+ workflows :
79+ version : 2
80+ build_and_deploy :
81+ jobs :
82+ - build :
83+ filters :
84+ tags :
85+ only : /.*/
86+ - deploy :
87+ requires :
88+ - build
89+ filters :
90+ tags :
91+ only : /.*/
92+ branches :
93+ ignore : /.*/
Original file line number Diff line number Diff line change 1+ package :
2+ python setup.py sdist
3+ python setup.py bdist_wheel
Original file line number Diff line number Diff line change 11import torch .nn as nn
22
3- from model .transformer import TransformerBlock
4- from model .embedding import BERTEmbedding
3+ from .transformer import TransformerBlock
4+ from .embedding import BERTEmbedding
55
66
77class BERT (nn .Module ):
Original file line number Diff line number Diff line change 1- from .bert import BERT
21import torch .nn as nn
32
3+ from .bert import BERT
4+
45
56class BERTLM (nn .Module ):
67 """
Original file line number Diff line number Diff line change 33from torch .optim import Adam
44from torch .utils .data import DataLoader
55
6- from model import BERTLM , BERT
6+ from .. model import BERTLM , BERT
77
88import tqdm
99
Original file line number Diff line number Diff line change 1+ import unittest
2+ from bert_pytorch import BERT
3+
4+
5+ class BERTTestCase (unittest .TestCase ):
6+ pass
You can’t perform that action at this time.
0 commit comments