Skip to content

Commit fe33a68

Browse files
committed
chore: update docs
1 parent 36b070b commit fe33a68

File tree

3 files changed

+18
-30
lines changed

3 files changed

+18
-30
lines changed

.github/workflows/wiki-publish.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
- uses: actions/[email protected]
1515
- uses: nglehuy/github-wiki-action@master
1616
with:
17-
strategy: clone
1817
token: ${{ secrets.TOKEN }}
19-
path: ./
18+
path: docs
2019
preprocess: true

README.md

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<h1 align="center">
2-
<p>TensorFlowASR :zap:</p>
2+
TensorFlowASR :zap:
3+
</h1>
34
<p align="center">
45
<a href="https://github.com/TensorSpeech/TensorFlowASR/blob/main/LICENSE">
56
<img alt="GitHub" src="https://img.shields.io/github/license/TensorSpeech/TensorFlowASR?logo=apache&logoColor=green">
@@ -10,9 +11,8 @@
1011
<img alt="PyPI" src="https://img.shields.io/pypi/v/TensorFlowASR?color=%234285F4&label=release&logo=pypi&logoColor=%234285F4">
1112
</a>
1213
</p>
13-
</h1>
1414
<h2 align="center">
15-
<p>Almost State-of-the-art Automatic Speech Recognition in Tensorflow 2</p>
15+
Almost State-of-the-art Automatic Speech Recognition in Tensorflow 2
1616
</h2>
1717

1818
<p align="center">
@@ -161,32 +161,9 @@ See [augmentations](./tensorflow_asr/augmentations/README.md)
161161

162162
After converting to tflite, the tflite model is like a function that transforms directly from an **audio signal** to **unicode code points**, then we can convert unicode points to string.
163163

164-
1. Install `tf-nightly` using `pip install tf-nightly`
165-
2. Build a model with the same architecture as the trained model _(if model has tflite argument, you must set it to True)_, then load the weights from trained model to the built model
166-
3. Load `TFSpeechFeaturizer` and `TextFeaturizer` to model using function `add_featurizers`
167-
4. Convert model's function to tflite as follows:
168-
169-
```python
170-
func = model.make_tflite_function(**options) # options are the arguments of the function
171-
concrete_func = func.get_concrete_function()
172-
converter = tf.lite.TFLiteConverter.from_concrete_functions([concrete_func])
173-
converter.experimental_new_converter = True
174-
converter.optimizations = [tf.lite.Optimize.DEFAULT]
175-
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS,
176-
tf.lite.OpsSet.SELECT_TF_OPS]
177-
tflite_model = converter.convert()
178-
```
179-
180-
5. Save the converted tflite model as follows:
181-
182-
```python
183-
if not os.path.exists(os.path.dirname(tflite_path)):
184-
os.makedirs(os.path.dirname(tflite_path))
185-
with open(tflite_path, "wb") as tflite_out:
186-
tflite_out.write(tflite_model)
187-
```
164+
See [tflite_convertion](./docs/tutorials/tflite.md)
188165

189-
5. Then the `.tflite` model is ready to be deployed
166+
1. Then the `.tflite` model is ready to be deployed
190167

191168
## Pretrained Models
192169

docs/tutorials/tflite.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# TFLite Conversion Tutorial
2+
3+
## Run
4+
5+
```bash
6+
python examples/train.py \
7+
--config-path=/path/to/config.yml.j2 \
8+
--h5=/path/to/weight.h5 \
9+
--output=/path/to/output.tflite
10+
## See others params
11+
python examples/tflite.py --help
12+
```

0 commit comments

Comments
 (0)