okeowo1014 commited on
Commit
685db66
1 Parent(s): 246842a

Update train.py

Browse files
Files changed (1) hide show
  1. train.py +10 -2
train.py CHANGED
@@ -108,13 +108,21 @@ model.summary()
108
  # )
109
  # Save the model with a valid extension (recommended: .h5)
110
  model.save('cat_dog_classifierss.keras')
 
 
 
 
 
 
 
 
111
  # tf.keras.models.save_model(model, 'cat_dog_classifierss.keras')
112
  # Authenticate with Hugging Face (replace YOUR_TOKEN with your actual token)
113
  # from huggingface_hub import hf_hub_auth
114
  # hf_hub_auth(token=sac)
115
  # Recreate the exact same model purely from the file
116
- new_model = tf.keras.models.load_model('cat_dog_classifierss.keras')
117
  # Push the model to Hugging Face Hub with a descriptive name
118
- model_repo = push_to_hub_keras(new_model, repo_id="okeowo1014/kerascatanddog",token=sac) # Optional organization
119
 
120
  print(f"Model pushed to Hugging Face Hub: {model_repo}")
 
108
  # )
109
  # Save the model with a valid extension (recommended: .h5)
110
  model.save('cat_dog_classifierss.keras')
111
+
112
+ push_to_hub_keras(
113
+ model,
114
+ repo_id="okeowo1014/catsanddogs",
115
+ commit_message="Initial commit",
116
+ token=sac,
117
+ include_optimizer=True,
118
+ )
119
  # tf.keras.models.save_model(model, 'cat_dog_classifierss.keras')
120
  # Authenticate with Hugging Face (replace YOUR_TOKEN with your actual token)
121
  # from huggingface_hub import hf_hub_auth
122
  # hf_hub_auth(token=sac)
123
  # Recreate the exact same model purely from the file
124
+ # new_model = tf.keras.models.load_model('cat_dog_classifierss.keras')
125
  # Push the model to Hugging Face Hub with a descriptive name
126
+ # model_repo = push_to_hub_keras(new_model, repo_id="okeowo1014/kerascatanddog",token=sac) # Optional organization
127
 
128
  print(f"Model pushed to Hugging Face Hub: {model_repo}")