okeowo1014 commited on
Commit
da40e62
1 Parent(s): 05aa392

Update train.py

Browse files
Files changed (1) hide show
  1. train.py +7 -4
train.py CHANGED
@@ -86,13 +86,16 @@ print('Test accuracy:', test_acc)
86
  # Save the model for future use (optional)
87
  # Not recommended for Hugging Face Hub upload (use tf.saved_model.save())
88
 
89
- # # Export the model for Hugging Face Hub using tf.saved_model.save()
90
- # export_dir = 'saved_model' # Create a directory for the SavedModel
91
- # tf.saved_model.save(model, export_dir)
 
 
92
 
93
  # Upload the model to your Hugging Face space repository
94
  push_to_hub_keras(
95
- model, # Point to the SavedModel directory
 
96
  repo_id="okeowo1014/kerascatanddog",
97
  commit_message="cats and dog image classifier with transfer learning",
98
  tags=["image-classifier", "data-augmentation", "class-weights"],
 
86
  # Save the model for future use (optional)
87
  # Not recommended for Hugging Face Hub upload (use tf.saved_model.save())
88
 
89
+ # Export the model for Hugging Face Hub using tf.saved_model.save()
90
+ export_dir = 'saved_model' # Create a directory for the SavedModel
91
+ tf.saved_model.save(model, export_dir)
92
+ Save model weights to local directory
93
+ # model.save_pretrained("kerascatanddog")
94
 
95
  # Upload the model to your Hugging Face space repository
96
  push_to_hub_keras(
97
+ model=export_dir,
98
+ # model, # Point to the SavedModel directory
99
  repo_id="okeowo1014/kerascatanddog",
100
  commit_message="cats and dog image classifier with transfer learning",
101
  tags=["image-classifier", "data-augmentation", "class-weights"],