Skip to content
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
8 changes: 4 additions & 4 deletions .github/workflows/build_and_publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand All @@ -27,8 +29,6 @@ jobs:
run: >-
python -m
build
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
10 changes: 9 additions & 1 deletion openwakeword/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@ def __init__(
# Do imports for inference framework
if inference_framework == "tflite":
try:
import tflite_runtime.interpreter as tflite
try:
# Attempt to import the newer LiteRT runtime
import ai_edge_litert.interpreter as tflite
except ImportError:
try:
# Fallback to the original tflite_runtime if LiteRT is unavailable
import tflite_runtime.interpreter as tflite
except ImportError:
raise ImportError("Neither LiteRT nor TensorFlow Lite runtime found. Please install `ai_edge_litert` or `tflite_runtime`.")

def tflite_predict(tflite_interpreter, input_index, output_index, x):
tflite_interpreter.set_tensor(input_index, x)
Expand Down
10 changes: 7 additions & 3 deletions openwakeword/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,14 @@ def __init__(self,

elif inference_framework == "tflite":
try:
import tflite_runtime.interpreter as tflite
# Attempt to import the newer LiteRT runtime
import ai_edge_litert.interpreter as tflite
except ImportError:
raise ValueError("Tried to import the TFLite runtime, but it was not found."
"Please install it using `pip install tflite-runtime`")
try:
# Fallback to the original tflite_runtime if LiteRT is unavailable
import tflite_runtime.interpreter as tflite
except ImportError:
raise ImportError("Neither LiteRT nor TensorFlow Lite runtime found. Please install `ai_edge_litert` or `tflite_runtime`.")

if melspec_model_path == "":
melspec_model_path = os.path.join(pathlib.Path(__file__).parent.resolve(),
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ testpaths = [
]

[project]
name = "openwakeword"
name = "private-assistant-openwakeword"
version = "0.6.0"
authors = [
{ name="David Scripka", email="david.scripka@gmail.com" },
{ name="stkr22", email="stkr22@github.com" },
]
description = "An open-source audio wake word (or phrase) detection framework with a focus on performance and simplicity"
description = "An open-source audio wake word (or phrase) detection framework with a focus on performance and simplicity. Fork of the original package."
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
Expand All @@ -27,4 +27,4 @@ classifiers = [
dynamic = ["dependencies", "optional-dependencies"]

[project.urls]
"Homepage" = "https://github.com/dscripka/openWakeWord"
"Homepage" = "https://github.com/stkr22/openWakeWord"
19 changes: 10 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ def build_additional_requires():
return additional_requires

setuptools.setup(
name="openwakeword",
version="0.6.0",
name="private-assistant-openwakeword",
version="0.6.1",
install_requires=[
'onnxruntime>=1.10.0,<2',
'tflite-runtime>=2.8.0,<3; platform_system == "Linux"',
'tqdm>=4.0,<5.0',
'scipy>=1.3,<2',
'scikit-learn>=1,<2',
'requests>=2.0,<3',
],
extras_require={
'onnx': ['onnxruntime>=1.10.0,<2'],
'tflite': ['tflite-runtime>=2.8.0,<3'],
'litert': ['ai-edge-litert>=1.0.1,<2'],
'test': [
'pytest>=7.2.0,<8',
'pytest-cov>=2.10.1,<3',
Expand Down Expand Up @@ -74,14 +75,14 @@ def build_additional_requires():
'deep-phonemizer==0.0.19'
]
},
author="David Scripka",
author_email="david.scripka@gmail.com",
description="An open-source audio wake word (or phrase) detection framework with a focus on performance and simplicity",
author="stkr22",
author_email="stk22@github.com",
description="An open-source audio wake word (or phrase) detection framework with a focus on performance and simplicity. Fork of the original package.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://pypi.org/project/openwakeword",
url="https://pypi.org/project/private-assistant-openwakeword",
project_urls={
"Bug Tracker": "https://pypi.org/project/openwakeword/issues",
"Bug Tracker": "https://pypi.org/project/private-assistant-openwakeword/issues",
},
classifiers=[
"Programming Language :: Python :: 3",
Expand Down