Skip to content

Commit 08ffcd0

Browse files
chore(format): run black on main
1 parent 55ca11f commit 08ffcd0

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

chattts-tf/convert_to_tflite.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
import tensorflow as tf
22
import os
33

4+
45
def convert_to_tflite():
56
# Load the SavedModel
6-
model = tf.saved_model.load('chattts_tf')
7-
7+
model = tf.saved_model.load("chattts_tf")
8+
89
# Create TFLite converter
9-
converter = tf.lite.TFLiteConverter.from_saved_model('chattts_tf')
10-
10+
converter = tf.lite.TFLiteConverter.from_saved_model("chattts_tf")
11+
1112
# Set optimization flags
1213
converter.optimizations = [tf.lite.Optimize.DEFAULT]
1314
converter.target_spec.supported_types = [tf.float32]
14-
15+
1516
# Convert the model
1617
tflite_model = converter.convert()
17-
18+
1819
# Save the TFLite model
19-
with open('chattts_model.tflite', 'wb') as f:
20+
with open("chattts_model.tflite", "wb") as f:
2021
f.write(tflite_model)
21-
22+
2223
print("Model converted successfully to TFLite format")
2324

24-
if __name__ == '__main__':
25-
convert_to_tflite()
25+
26+
if __name__ == "__main__":
27+
convert_to_tflite()

0 commit comments

Comments
 (0)