|
1 | 1 | <h1 align="center"> |
2 | | -<p>TensorFlowASR :zap:</p> |
| 2 | +TensorFlowASR :zap: |
| 3 | +</h1> |
3 | 4 | <p align="center"> |
4 | 5 | <a href="https://github.com/TensorSpeech/TensorFlowASR/blob/main/LICENSE"> |
5 | 6 | <img alt="GitHub" src="https://img.shields.io/github/license/TensorSpeech/TensorFlowASR?logo=apache&logoColor=green"> |
|
10 | 11 | <img alt="PyPI" src="https://img.shields.io/pypi/v/TensorFlowASR?color=%234285F4&label=release&logo=pypi&logoColor=%234285F4"> |
11 | 12 | </a> |
12 | 13 | </p> |
13 | | -</h1> |
14 | 14 | <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 |
16 | 16 | </h2> |
17 | 17 |
|
18 | 18 | <p align="center"> |
@@ -161,32 +161,9 @@ See [augmentations](./tensorflow_asr/augmentations/README.md) |
161 | 161 |
|
162 | 162 | 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. |
163 | 163 |
|
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) |
188 | 165 |
|
189 | | -5. Then the `.tflite` model is ready to be deployed |
| 166 | +1. Then the `.tflite` model is ready to be deployed |
190 | 167 |
|
191 | 168 | ## Pretrained Models |
192 | 169 |
|
|
0 commit comments