arsath-sm commited on
Commit
b113f1f
1 Parent(s): 534868b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,10 +5,11 @@ import numpy as np
5
  from huggingface_hub import hf_hub_download
6
  import os
7
 
8
-
 
 
9
 
10
  # Load the models
11
-
12
  model1 = load_model_from_hub("arsath-sm/face_classification_model1", "face_classification_model1.h5")
13
  model2 = load_model_from_hub("arsath-sm/face_classification_model2", "face_classification_model2.h5")
14
 
 
5
  from huggingface_hub import hf_hub_download
6
  import os
7
 
8
+ def load_model_from_hub(repo_id, filename):
9
+ model_path = hf_hub_download(repo_id=repo_id, filename=filename)
10
+ return tf.keras.models.load_model(model_path)
11
 
12
  # Load the models
 
13
  model1 = load_model_from_hub("arsath-sm/face_classification_model1", "face_classification_model1.h5")
14
  model2 = load_model_from_hub("arsath-sm/face_classification_model2", "face_classification_model2.h5")
15