okeowo1014 commited on
Commit
a7050e0
·
verified ·
1 Parent(s): 5fe90fd

Update tr.py

Browse files
Files changed (1) hide show
  1. tr.py +4 -4
tr.py CHANGED
@@ -42,12 +42,12 @@ loss, accuracy = model.evaluate(X_test, y_test)
42
  print(f'Accuracy: {accuracy * 100:.2f}%')
43
 
44
  # Save the model with the correct filepath extension
45
- # model.save('my_custom_text_classifier')
46
- tf.saved_model.save(model, "my_custom_text_classifier")
47
 
48
  # Later, load the model and make predictions
49
- # loaded_model = tf.keras.models.load_model('my_custom_text_classifier')
50
- loaded_model =tf.keras.layers.TFSMLayer("my_custom_text_classifier", call_endpoint="serving_default")
51
 
52
 
53
  # Example prediction
 
42
  print(f'Accuracy: {accuracy * 100:.2f}%')
43
 
44
  # Save the model with the correct filepath extension
45
+ model.save('my_custom_text_classifier.keras')
46
+ # tf.saved_model.save(model, "my_custom_text_classifier")
47
 
48
  # Later, load the model and make predictions
49
+ loaded_model = tf.keras.models.load_model('my_custom_text_classifier.keras')
50
+ # loaded_model =tf.keras.layers.TFSMLayer("my_custom_text_classifier", call_endpoint="serving_default")
51
 
52
 
53
  # Example prediction