Tantawi commited on
Commit
48c4be3
·
verified ·
1 Parent(s): 4d4e0dd

Update app/model_loader.py

Browse files
Files changed (1) hide show
  1. app/model_loader.py +8 -5
app/model_loader.py CHANGED
@@ -1,8 +1,11 @@
1
- import os
2
  import tensorflow as tf
3
 
4
- MODEL_PATH = "app/model/efficientnetv2s.h5"
5
-
6
  def load_model():
7
- print("Loading pre-downloaded model...")
8
- return tf.keras.models.load_model(MODEL_PATH)
 
 
 
 
 
 
1
+ from huggingface_hub import hf_hub_download
2
  import tensorflow as tf
3
 
 
 
4
  def load_model():
5
+ # Download the model file from the public repo
6
+ model_path = hf_hub_download(
7
+ repo_id="Miguel764/efficientnetv2s-skin-cancer-classifier", # public repo
8
+ filename="efficientnetv2s.h5" # file name inside the repo
9
+ )
10
+ # Load the downloaded model
11
+ return tf.keras.models.load_model(model_path)