Skip to content

Commit bcea1e7

Browse files
committed
Renames build-linux-python folder
Preparing for macOS build.
1 parent b805103 commit bcea1e7

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ __pycache__/
1414
examples/out.txt
1515
.DS_Store
1616
# Python extension module for TEN VAD C++/C and ONNX runtime.
17-
examples_onnx/build-python
17+
examples_onnx/build-linux-python

examples_onnx/README_python.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The Python build script automatically:
5555
- Builds Python extension module in `lib/` folder with CMake
5656
- Creates necessary symlink to ONNX model file in `onnx_model/`
5757
- Copies demo script to build directory for easy testing
58-
- All artifacts are consolidated in `build-python/`
58+
- All artifacts are consolidated in `build-linux-python/`
5959

6060
Auto-detection paths for ONNX Runtime.
6161
- x86_64: `$HOME/onnxruntime-linux-x64-1.22.0`
@@ -64,15 +64,15 @@ For a different ONNX Runtime versions, use `--ort-path` option.
6464

6565
Inspect the Python extension module.
6666
```bash
67-
ls build-python/lib/
67+
ls build-linux-python/lib/
6868
```
6969
```console
7070
ten_vad_python.cpython-312-aarch64-linux-gnu.so
7171
```
7272

7373
Test the import in the build directory.
7474
```bash
75-
cd build-python
75+
cd build-linux-python
7676
python3 -c 'import sys; sys.path.insert(0, "lib"); import ten_vad_python; print("Import success!")'
7777
```
7878

@@ -82,7 +82,7 @@ Runs from the build directory. The demo requires `numpy`, which is already
8282
installed in the virtual environment created by the build script.
8383
```bash
8484
cd
85-
cd ten-vad/examples_onnx/build-python
85+
cd ten-vad/examples_onnx/build-linux-python
8686
source ./venv/bin/activate
8787

8888
python3 ten_vad_demo.py ../../examples/s0724-s0730.wav out-python.txt
@@ -96,7 +96,7 @@ python3 ten_vad_demo.py ../../examples/s0724-s0730.wav out-python-threshold.txt
9696
### Porting the demo
9797

9898
Create a new folder and copy three artifacts.
99-
* `lib/` folder from `build-python`
99+
* `lib/` folder from `build-linux-python`
100100
* `onnx_model/` folder from `src`
101101
* `ten_vad_demo.py` script from `examples_onnx`
102102

@@ -151,10 +151,10 @@ import sys
151151
import os
152152
import numpy as np # For audio handling
153153

154-
# Add lib directory to Python path (from build-python/ directory)
154+
# Add lib directory to Python path (from build-linux-python/ directory)
155155
sys.path.insert(0, "lib")
156156
# Or from examples_onnx/ directory:
157-
# sys.path.insert(0, os.path.join("build-python", "lib"))
157+
# sys.path.insert(0, os.path.join("build-linux-python", "lib"))
158158

159159
import ten_vad_python
160160

@@ -179,7 +179,7 @@ print(f"Is voice: {is_voice}")
179179
Python usage example `ten_vad_demo.py` requires the extracted ONNX Runtime
180180
folder and these files to run on Linux ARM64 with Python 3.12.
181181
```console
182-
examples_onnx/build-python
182+
examples_onnx/build-linux-python
183183
├── lib
184184
│ └── ten_vad_python.cpython-312-aarch64-linux-gnu.so
185185
├── onnx_model -> ../../src/onnx_model

examples_onnx/build-and-deploy-linux-python.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ if ! command -v cmake &> /dev/null; then
3737
fi
3838

3939
# Create build directory
40-
rm -rf build-python
41-
mkdir build-python
40+
rm -rf build-linux-python
41+
mkdir build-linux-python
4242

4343
# Create virtual environment if not in one
4444
if [[ -z "${VIRTUAL_ENV:-}" ]]; then
45-
if [[ ! -d "build-python/venv" ]]; then
45+
if [[ ! -d "build-linux-python/venv" ]]; then
4646
echo "Creating virtual environment..."
47-
python3 -m venv build-python/venv
47+
python3 -m venv build-linux-python/venv
4848
fi
4949
echo "Activating virtual environment..."
50-
source build-python/venv/bin/activate
50+
source build-linux-python/venv/bin/activate
5151
fi
5252

5353
# Install pybind11 if needed
5454
echo "Installing pybind11 and numpy..."
5555
pip install -q pybind11 numpy
5656

5757
# Setup build directory
58-
cd build-python
58+
cd build-linux-python
5959
cp ../CMakeLists-python.txt ./CMakeLists.txt
6060

6161
# Create ONNX model symlink in build directory
@@ -73,11 +73,11 @@ else
7373
fi
7474
make -j$(nproc)
7575

76-
# Move module to lib directory within build-python
76+
# Move module to lib directory within build-linux-python
7777
mkdir -p lib
7878
mv ten_vad_python*.so lib/
7979

80-
# Copy demo script to build-python for easy testing
80+
# Copy demo script to build-linux-python for easy testing
8181
cp ../ten_vad_demo.py .
8282

8383
python3 ./ten_vad_demo.py ../../examples/s0724-s0730.wav out-python.txt
@@ -86,4 +86,4 @@ deactivate
8686
cd ..
8787

8888
echo "Build complete."
89-
echo "All artifacts in: build-python/"
89+
echo "All artifacts in: build-linux-python/"

0 commit comments

Comments
 (0)