<jupyter_start><jupyter_text>Vitis-AI<jupyter_code>tacotron2_model_path = './tacotron2_saved_model_english'
model = tf.keras.models.load_model(tacotron2_model_path)
 
model
from tensorflow_model_optimization.quantization.keras import vitis_quantize

quantizer = vitis_quantize.VitisQuantizer(model)

quantized_model = quantizer.quantize_model(calib_dataset = calib_dataset[1:100])
# Save the model
quantized_model.save(save_dir + 'vitis-ai-quantized_mnist_model.h5')
quantized_model.summary()
!vai_c_tensorflow2 -h
!vai_c_tensorflow2 -m mnist-results/vitis-ai-quantized_mnist_model.h5 -o mnist-results/ -n mnist_XIR<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09612403100775194, 'fraction_numerical': 0.017054263565891473, 'mean_word_length': 8.787878787878787, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '237095', 'license': 'Apache-2.0', 'n_tokens_mistral': 265, 'n_tokens_neox': 261, 'n_words': 29, 'path': 'notebooks/Tacotron2_LjSpeech_Optimization_Vitis_AI.ipynb', 'repo_name': 'neso613/TTS_Xilinx_Vitis_AI', 'size': '645'}