Skip to content

Commit

Permalink
Allow tensorflow in place of tflite
Browse files Browse the repository at this point in the history
As a distro we are packaging tensorflow, but not tflite. The latter is a
small cut-out of tensorflow, so they share the same entrypoint.

This allows us to provide tensorflow in place of tflite, at the cost of
a higher runtime closure size, but reduced maintenance load.
  • Loading branch information
mweinelt committed Sep 29, 2023
1 parent 87ff05c commit 23b1bc9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion programs/wake/openwakeword-lite/bin/server/openwakeword.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
from typing import List

import numpy as np
import tflite_runtime.interpreter as tflite
try:
import tflite_runtime.interpreter as tflite
except ModuleNotFoundError:
import tensorflow.lite as tflite

from wyoming.wake import Detection

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from typing import List, Optional, TextIO

import numpy as np
import tflite_runtime.interpreter as tflite
try:
import tflite_runtime.interpreter as tflite
except ModuleNotFoundError:
import tensorflow.lite as tflite

from wyoming.wake import Detection

Expand Down
5 changes: 4 additions & 1 deletion programs/wake/precise-lite/bin/precise_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
from typing import Any, Optional, Union

import numpy as np
import tflite_runtime.interpreter as tflite
try:
import tflite_runtime.interpreter as tflite
except ModuleNotFoundError:
import tensorflow.lite as tflite
from sonopy import mfcc_spec

MAX_WAV_VALUE = 32768
Expand Down

0 comments on commit 23b1bc9

Please sign in to comment.