dhhd255 commited on
Commit
d4fd4b1
·
1 Parent(s): 4bbcef6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -9,8 +9,12 @@ model_path = 'dhhd255/main_model/best_model.h5'
9
  with fs.open(model_path, 'rb') as f:
10
  model_content = f.read()
11
 
 
 
 
 
12
  # Load your custom model
13
- model = keras.models.load_model(model_content)
14
 
15
  # Define a function that takes an image as input and uses the model for inference
16
  def image_classifier(image):
 
9
  with fs.open(model_path, 'rb') as f:
10
  model_content = f.read()
11
 
12
+ # Save the model file to disk
13
+ with open('best_model.h5', 'wb') as f:
14
+ f.write(model_content)
15
+
16
  # Load your custom model
17
+ model = keras.models.load_model('best_model.h5')
18
 
19
  # Define a function that takes an image as input and uses the model for inference
20
  def image_classifier(image):