fix some build and env issues. (#111)
This commit is contained in:
Родитель
f4e1be286a
Коммит
fd1216b027
|
@ -26,7 +26,7 @@ fi
|
|||
|
||||
# Build wheels
|
||||
if [ "$GITHUB_EVENT_NAME" == "schedule" ]; then
|
||||
python setup.py bdist_wheel --weekly_build || { echo "Building wheels failed."; exit 1; }
|
||||
python setup.py bdist_wheel --nightly_build || { echo "Building wheels failed."; exit 1; }
|
||||
else
|
||||
python setup.py bdist_wheel || { echo "Building wheels failed."; exit 1; }
|
||||
fi
|
||||
|
|
|
@ -32,6 +32,7 @@ out/
|
|||
*.egg-info/
|
||||
.setuptools-cmake-build/
|
||||
onnxruntime-*-*-*/
|
||||
temp_*.onnx
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
|
|
8
setup.py
8
setup.py
|
@ -20,6 +20,12 @@ import subprocess
|
|||
|
||||
|
||||
TOP_DIR = os.path.dirname(__file__)
|
||||
PACKAGE_NAME = 'onnxruntime_extensions'
|
||||
|
||||
|
||||
if '--nightly_build' in sys.argv:
|
||||
PACKAGE_NAME = 'ortext_nightly'
|
||||
sys.argv.remove('--nightly_build')
|
||||
|
||||
|
||||
@contextmanager
|
||||
|
@ -153,7 +159,7 @@ with open(os.path.join(TOP_DIR, "README.md"), 'r') as f:
|
|||
long_description = long_description[start_pos:end_pos]
|
||||
|
||||
setup(
|
||||
name='onnxruntime_extensions',
|
||||
name=PACKAGE_NAME,
|
||||
version=read_version(),
|
||||
packages=packages,
|
||||
package_dir=package_dir,
|
||||
|
|
|
@ -36,7 +36,7 @@ class TestTorchE2E(unittest.TestCase):
|
|||
tc_sess.save_as_onnx(f, rout)
|
||||
|
||||
m = onnx.load_model_from_string(f.getvalue())
|
||||
onnx.save_model(m, 'range.onnx')
|
||||
onnx.save_model(m, 'temp_range.onnx')
|
||||
fu_m = eager_op.EagerOp.from_model(m)
|
||||
result = fu_m(num)
|
||||
np.testing.assert_array_equal(result, np.array(range(num)))
|
||||
|
@ -52,14 +52,14 @@ class TestTorchE2E(unittest.TestCase):
|
|||
tc_sess.save_as_onnx(f, fuse_output)
|
||||
|
||||
m = onnx.load_model_from_string(f.getvalue())
|
||||
onnx.save_model(m, 'test00.onnx')
|
||||
onnx.save_model(m, 'temp_test00.onnx')
|
||||
fu_m = eager_op.EagerOp.from_model(m)
|
||||
result = fu_m(input_text)
|
||||
np.testing.assert_array_equal(result, [2, 2])
|
||||
|
||||
def test_imagenet_postprocess(self):
|
||||
mb_core_path = "mobilev2.onnx"
|
||||
mb_full_path = "mobilev2_full.onnx"
|
||||
mb_core_path = 'temp_mobilev2.onnx'
|
||||
mb_full_path = 'temp_mobilev2_full.onnx'
|
||||
dummy_input = torch.randn(10, 3, 224, 224)
|
||||
np_input = dummy_input.numpy()
|
||||
torch.onnx.export(self.mobilenet, dummy_input, mb_core_path, opset_version=11)
|
||||
|
|
|
@ -445,7 +445,7 @@ class TestPythonOpSentencePiece(unittest.TestCase):
|
|||
np.array([flags & 1], dtype=np.bool_),
|
||||
np.array([flags & 2], dtype=np.bool_),
|
||||
np.array([flags & 4], dtype=np.bool_))
|
||||
self.assertEquals(tokens.tolist(), [1095, 4054, 26, 2022, 755, 99935])
|
||||
self.assertEqual(tokens.tolist(), [1095, 4054, 26, 2022, 755, 99935])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -68,7 +68,7 @@ class TestPyTorchCustomOp(unittest.TestCase):
|
|||
self.assertIn('domain: "ai.onnx.contrib"', str(onnx_model))
|
||||
|
||||
model = CustomInverse()
|
||||
onnx.save_model(onnx_model, 'pytorchcustomop.onnx')
|
||||
onnx.save_model(onnx_model, 'temp_pytorchcustomop.onnx')
|
||||
pt_outputs = model(x0, x1)
|
||||
|
||||
run_ort = EagerOp.from_model(onnx_model)
|
||||
|
|
Загрузка…
Ссылка в новой задаче