feat: allow full tensorflow usage if available#178
Open
mikejgray wants to merge 2 commits intodscripka:mainfrom
Open
feat: allow full tensorflow usage if available#178mikejgray wants to merge 2 commits intodscripka:mainfrom
mikejgray wants to merge 2 commits intodscripka:mainfrom
Conversation
Contributor
Author
|
Hey @dscripka , please let me know if you want any changes on this PR. Happy to adjust it to meet your requirements! |
Owner
|
@mikejgray thanks for the follow-up. Could youadjust the logic so that it only imports from the full tensorflow package if it is both installed and the tflite package is not installed? This happens implicitly right now with the |
Contributor
Author
❯ python
Python 3.12.5 (main, Aug 13 2024, 09:22:07) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import openwakeword
>>> from openwakeword.model import Model
>>> Model()
WARNING:root:Tried to import the tflite runtime, but it was not found. Using tensorflow instead.
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
>>> import tflite_runtime.interpreter as tflite
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tflite_runtime'
>>> exit()
❯ pip list | grep tensor
tensorboard 2.18.0
tensorboard-data-server 0.7.2
tensorflow 2.18.0
❯ python
Python 3.12.5 (main, Aug 13 2024, 09:22:07) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from openwakeword.utils import AudioFeatures
>>> x=AudioFeatures(inference_framework="tflite")
WARNING:root:Tried to import the tflite runtime, but it was not found. Using tensorflow instead.
INFO: Created TensorFlow Lite XNNPACK delegate for CPU. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #159