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

script to build wheel file #380

Open
wants to merge 3 commits into
base: OpenKE-PyTorch
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ We have provided the hyper-parameters of some models to achieve the state-of-the

<strong> We are still trying more hyper-parameters and more training strategies (e.g., adversarial training and label smoothing regularization) for these models. </strong> Hence, this table is still in change. We welcome everyone to help us update this table and hyper-parameters.

## Pip Install

``` sh
./build.sh # build wheel file
pip install openke_***.whl # install
```

## Installation

Expand Down
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
python setup.py bdist_wheel -d ./

rm -rf *.so
rm -rf *.egg-info
rm -rf build
rm -rf dist
29 changes: 29 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from setuptools import setup, find_packages, Extension

version = '0.1.0'

# g++ ./base/Base.cpp -fPIC -shared -o Base.so -pthread -O3 -march=native

setup(
name="openke",
version=version,
license='MIT',
description='Pytorch Wrapper of C++ OpenKE-PyTorch',
author='thunlp',
url='https://github.com/thunlp/OpenKE',
packages=find_packages(),
ext_modules=[
Extension(
'base',
extra_compile_args=["-fPIC", "-shared", "-pthread", "-O3", "-march=native"],
extra_link_args=["-o", "OpenKEBase.so"],
sources=['./openke/base/Base.cpp']
)
],
data_files=[('lib', ['OpenKEBase.so'])],
install_requires=[
'numpy==1.16.4',
'scipy',
'torch==1.2.0'
],
)