Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bert_pytorch/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .model import BERT

__version__ = "0.0.1a0"
Empty file added bert_pytorch/__main__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion build_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dataset import WordVocab, BERTDatasetCreator
from bert_pytorch.dataset import WordVocab, BERTDatasetCreator

import argparse
import tqdm
Expand Down
2 changes: 1 addition & 1 deletion build_vocab.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse

from dataset import WordVocab
from bert_pytorch.dataset import WordVocab

parser = argparse.ArgumentParser()
parser.add_argument("-c", "--corpus_path", required=True, type=str)
Expand Down
47 changes: 47 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from setuptools import setup, find_packages
from setuptools.command.install import install
from bert_pytorch import __version__
import os
import sys

with open("requirements.txt") as f:
require_packages = [line[:-1] for line in f]

with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()


class VerifyVersionCommand(install):
"""Custom command to verify that the git tag matches our version"""
description = 'verify that the git tag matches our version'

def run(self):
tag = os.getenv('CIRCLE_TAG')

if tag != __version__:
info = "Git tag: {0} does not match the version of this app: {1}".format(
tag, __version__
)
sys.exit(info)


setup(
name="bert_pytorch",
version=__version__,
author='Junseong Kim',
author_email='codertimo@gmail.com',
packages=find_packages(),
install_requires=require_packages,
url="https://github.com/codertimo/BERT-pytorch",
description="Google AI 2018 BERT pytorch implementation",
long_description=long_description,
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
],
cmdclass={
'verify': VerifyVersionCommand,
}
)
6 changes: 3 additions & 3 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from torch.utils.data import DataLoader

from model import BERT
from trainer import BERTTrainer
from dataset import BERTDataset, WordVocab
from bert_pytorch import BERT
from bert_pytorch.trainer import BERTTrainer
from bert_pytorch.dataset import BERTDataset, WordVocab

parser = argparse.ArgumentParser()

Expand Down