Instructions to use keras-sd/text-encoder-tflite with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use keras-sd/text-encoder-tflite with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://keras-sd/text-encoder-tflite") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -13,5 +13,6 @@ This repository hosts the TFLite version of `text encoder` part of [KerasCV Stab
|
|
| 13 |
Stable Diffusion consists of `text encoder`, `diffusion model`, `decoder`, and some glue codes to handl inputs and outputs of each part. The TFLite version of `text encoder` in this repository is built not only with the `text encoder` itself but also TensorFlow operations that generates `context` and `unconditional context`. These output should be passed down to the `diffusion model` which is hosted in [this repository](https://huggingface.co/keras-sd/diffusion-model-tflite/tree/main).
|
| 14 |
|
| 15 |
TFLite conversion was based on the `SavedModel` from [this repository](https://huggingface.co/keras-sd/tfs-text-encoder/tree/main), and TensorFlow version `>= 2.12-nightly` was used.
|
|
|
|
| 16 |
- NOTE: TensorFlow version `< 2.12-nightly` will fail for the conversion process.
|
| 17 |
- NOTE: For those who wonder how `SavedModel` is constructed, find it in [keras-sd-serving repository](https://github.com/deep-diver/keras-sd-serving).
|
|
|
|
| 13 |
Stable Diffusion consists of `text encoder`, `diffusion model`, `decoder`, and some glue codes to handl inputs and outputs of each part. The TFLite version of `text encoder` in this repository is built not only with the `text encoder` itself but also TensorFlow operations that generates `context` and `unconditional context`. These output should be passed down to the `diffusion model` which is hosted in [this repository](https://huggingface.co/keras-sd/diffusion-model-tflite/tree/main).
|
| 14 |
|
| 15 |
TFLite conversion was based on the `SavedModel` from [this repository](https://huggingface.co/keras-sd/tfs-text-encoder/tree/main), and TensorFlow version `>= 2.12-nightly` was used.
|
| 16 |
+
- NOTE: [Dynamic range quantization](https://www.tensorflow.org/lite/performance/post_training_quant#optimizing_an_existing_model) was used.
|
| 17 |
- NOTE: TensorFlow version `< 2.12-nightly` will fail for the conversion process.
|
| 18 |
- NOTE: For those who wonder how `SavedModel` is constructed, find it in [keras-sd-serving repository](https://github.com/deep-diver/keras-sd-serving).
|