Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup improvements #338

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -112,11 +112,13 @@ ckpt
# vscode
.vscode

# JetBrains PyCharm
.idea

# tacred
benchmark/tacred
*.swp

<<<<<<< HEAD
# data and pretrain
pretrain
benchmark
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
@@ -0,0 +1 @@
include requirements.txt
18 changes: 4 additions & 14 deletions README.md
Expand Up @@ -64,23 +64,13 @@ If it is too slow, you can try
git clone https://github.com/thunlp/OpenNRE.git --depth 1
```

Then install all the requirements:

Then install the package with:
```
pip install -r requirements.txt
pip install -e .
```
if you don't want to modify the code, you can skip `-e ` flag.

**Note**: Please choose appropriate PyTorch version based on your machine (related to your CUDA version). For details, refer to https://pytorch.org/.

Then install the package with
```
python setup.py install
```

If you also want to modify the code, run this:
```
python setup.py develop
```
**Note**: Please install appropriate PyTorch version based on your machine (related to your CUDA version). For details, refer to https://pytorch.org/.

Note that we have excluded all data and pretrain files for fast deployment. You can manually download them by running scripts in the ``benchmark`` and ``pretrain`` folders. For example, if you want to download FewRel dataset, you can run

Expand Down
42 changes: 26 additions & 16 deletions setup.py
@@ -1,17 +1,27 @@
import setuptools
with open("README.md", "r") as fh:
setuptools.setup(
name='opennre',
version='0.1',
author="Tianyu Gao",
author_email="gaotianyu1350@126.com",
description="An open source toolkit for relation extraction",
url="https://github.com/thunlp/opennre",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: Linux",
],
setup_requires=['wheel']
)


def read(filename: str) -> str:
with open(filename, "r") as f:
return f.read()


setuptools.setup(
name="opennre",
version="0.1",
author="Tianyu Gao",
author_email="gaotianyu1350@126.com",
description="An open source toolkit for relation extraction",
url="https://github.com/thunlp/opennre",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: Linux",
],
setup_requires=["wheel"],
install_requires=read("requirements.txt").strip().splitlines(),
long_description=read("README.md"),
long_description_content_type="text/markdown",
license_files=("LICENSE",),
)