uwu_classifier/interactive.py
Slendi b8acb45e68
Initial commit.
Signed-off-by: Slendi <slendi@socopon.com>
2023-11-05 00:34:30 +02:00

16 lines
440 B
Python
Executable File

#!/usr/bin/env python3
import tensorflow as tf
@tf.keras.utils.register_keras_serializable(package='Custom', name=None)
def text_standardizer(input_data):
lowercase = tf.strings.lower(input_data)
return lowercase
with tf.keras.utils.CustomObjectScope({'text_standardizer': text_standardizer}):
model = tf.keras.models.load_model('final_model')
model.summary()
while True:
print(model.predict([input('> ')]))